summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-09-08 11:21:45 -0700
committerBen Pfaff <blp@nicira.com>2011-09-15 11:10:36 -0700
commit109b8459218973f7fba72fc606bcdbbb306592de (patch)
treea92f8f31616e30cefa65a286279bedffb2e69a7a /ofproto
parenteb6e978cc1119c651efe48aeffc22e1827e4458a (diff)
downloadopenvswitch-109b8459218973f7fba72fc606bcdbbb306592de.tar.gz
ofproto: Remove dummy 'in_port' variable.
Seems like a very small cleanup.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto.c3
-rw-r--r--ofproto/pktbuf.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 979335543..7748ef1b8 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1590,7 +1590,6 @@ handle_packet_out(struct ofconn *ofconn, const struct ofp_header *oh)
struct ofpbuf request;
struct flow flow;
size_t n_ofp_actions;
- uint16_t in_port;
int error;
COVERAGE_INC(ofproto_packet_out);
@@ -1614,7 +1613,7 @@ handle_packet_out(struct ofconn *ofconn, const struct ofp_header *oh)
/* Get payload. */
if (opo->buffer_id != htonl(UINT32_MAX)) {
error = ofconn_pktbuf_retrieve(ofconn, ntohl(opo->buffer_id),
- &buffer, &in_port);
+ &buffer, NULL);
if (error || !buffer) {
return error;
}
diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c
index 02c590cf6..fc4c66ca1 100644
--- a/ofproto/pktbuf.c
+++ b/ofproto/pktbuf.c
@@ -161,6 +161,8 @@ pktbuf_get_null(void)
* identifies a "null" packet buffer (created with pktbuf_get_null()), stores
* NULL in '*bufferp' and UINT16_max in '*in_port'.
*
+ * 'in_port' may be NULL if the input port is not of interest.
+ *
* A returned packet will have at least sizeof(struct ofp_packet_in) bytes of
* headroom.
*
@@ -189,7 +191,9 @@ pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct ofpbuf **bufferp,
struct ofpbuf *buffer = p->buffer;
if (buffer) {
*bufferp = buffer;
- *in_port = p->in_port;
+ if (in_port) {
+ *in_port = p->in_port;
+ }
p->buffer = NULL;
COVERAGE_INC(pktbuf_retrieved);
return 0;
@@ -211,7 +215,9 @@ pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct ofpbuf **bufferp,
}
error:
*bufferp = NULL;
- *in_port = UINT16_MAX;
+ if (in_port) {
+ *in_port = UINT16_MAX;
+ }
return error;
}