From: Justin Pettit Date: Tue, 13 Nov 2012 02:57:42 +0000 (-0800) Subject: ofproto-dpif: Correct in_port on send_packet(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0958f12880427e4f3ea3fcc758a3ddf681ae6f5d;p=openvswitch ofproto-dpif: Correct in_port on send_packet(). 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 --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index fe0aae3b..098a43ee 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -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) {