ofp-util: make_packet_out() shouldn't receive OVSP_NONE.
authorJesse Gross <jesse@nicira.com>
Thu, 29 Sep 2011 20:30:07 +0000 (13:30 -0700)
committerJesse Gross <jesse@nicira.com>
Thu, 29 Sep 2011 21:35:58 +0000 (14:35 -0700)
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.

lib/ofp-util.c

index 5f7937f642e26516ad3e788994cb491cb507d8b2..52a996a54cc7acfab9ef0d5b9f66aaf71eef039a 100644 (file)
@@ -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) {