From 109b8459218973f7fba72fc606bcdbbb306592de Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 8 Sep 2011 11:21:45 -0700 Subject: [PATCH] ofproto: Remove dummy 'in_port' variable. Seems like a very small cleanup. --- ofproto/ofproto.c | 3 +-- ofproto/pktbuf.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 97933554..7748ef1b 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 02c590cf..fc4c66ca 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; } -- 2.30.2