bridge: 'in_port' in flow_t is now an OpenFlow port number.
authorBen Pfaff <blp@nicira.com>
Tue, 13 Jul 2010 00:14:03 +0000 (17:14 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Jul 2010 00:14:03 +0000 (17:14 -0700)
Commit b79520fe4 (Restore ovs-vswitchd VLAN, mirror, bonding, QoS features
("xflow" only)) broke the treatment of flows arriving on the local port.
This is because previously these flows had an in_port of XFLOWP_LOCAL,
but now they have an in_port of OFPP_LOCAL.  This commit fixes the problem.

I don't know how this snuck through my testing, since it's trivial to find.
I did do testing; perhaps I didn't do testing with a controller at the
right stage in development.

vswitchd/bridge.c

index 0abb416..836c8b1 100644 (file)
@@ -2283,7 +2283,7 @@ is_admissible(struct bridge *br, const flow_t *flow, bool have_packet,
     int vlan;
 
     /* Find the interface and port structure for the received packet. */
-    in_iface = iface_from_xf_ifidx(br, flow->in_port);
+    in_iface = iface_from_xf_ifidx(br, ofp_port_to_xflow_port(flow->in_port));
     if (!in_iface) {
         /* No interface?  Something fishy... */
         if (have_packet) {
@@ -2868,7 +2868,7 @@ bond_send_learning_packets(struct port *port)
         n_packets++;
         compose_benign_packet(&packet, "Open vSwitch Bond Failover", 0xf177,
                               e->mac);
-        flow_extract(&packet, 0, XFLOWP_NONE, &flow);
+        flow_extract(&packet, 0, OFPP_NONE, &flow);
         retval = ofproto_send_packet(br->ofproto, &flow, actions, a - actions,
                                      &packet);
         if (retval) {