Skip to content

Commit

Permalink
ofproto: Remove dummy 'in_port' variable.
Browse files Browse the repository at this point in the history
Seems like a very small cleanup.
  • Loading branch information
blp committed Sep 15, 2011
1 parent eb6e978 commit 109b845
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ofproto/ofproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
10 changes: 8 additions & 2 deletions ofproto/pktbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 109b845

Please sign in to comment.