From: Jesse Gross Date: Thu, 29 Sep 2011 20:30:07 +0000 (-0700) Subject: ofp-util: make_packet_out() shouldn't receive OVSP_NONE. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c24d40243cffe9096431a3ad53a7acfd236d001;p=openvswitch ofp-util: make_packet_out() shouldn't receive OVSP_NONE. make_packet_out() operates solely at the OpenFlow layer, so it should never receive OVSP_LOCAL as an in_port. This function is used only by the learning switch, which will never generate a packet with OVSP_LOCAL so this fixes not a bug but a violation of semantics. --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 5f7937f6..52a996a5 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1868,7 +1868,7 @@ make_packet_out(const struct ofpbuf *packet, uint32_t buffer_id, opo->header.length = htons(size); opo->header.xid = htonl(0); opo->buffer_id = htonl(buffer_id); - opo->in_port = htons(in_port == OVSP_LOCAL ? OFPP_LOCAL : in_port); + opo->in_port = htons(in_port); opo->actions_len = htons(actions_len); ofpbuf_put(out, actions, actions_len); if (packet) {