ofproto-dpif: Correct in_port on send_packet().
authorJustin Pettit <jpettit@nicira.com>
Tue, 13 Nov 2012 02:57:42 +0000 (18:57 -0800)
committerJustin Pettit <jpettit@nicira.com>
Fri, 16 Nov 2012 20:35:55 +0000 (12:35 -0800)
The switch to a single datapath uncovered a long-standing bug in the
send_packet() function.  The code had used an (invalid) ingress OpenFlow
port of 0, which happened to get translated to the datapath's local
port, which was always 0.  With the single datapath, this invalid
OpenFlow port number no longer maps properly, so switch-generated
packets could not be transmitted.  This patch properly sets the ingress
port to OFPP_LOCAL.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
ofproto/ofproto-dpif.c

index fe0aae3..098a43e 100644 (file)
@@ -5176,7 +5176,7 @@ send_packet(const struct ofport_dpif *ofport, struct ofpbuf *packet)
     struct flow flow;
     int error;
 
-    flow_extract(packet, 0, NULL, 0, &flow);
+    flow_extract(packet, 0, NULL, OFPP_LOCAL, &flow);
     odp_port = vsp_realdev_to_vlandev(ofproto, ofport->odp_port,
                                       flow.vlan_tci);
     if (odp_port != ofport->odp_port) {