bonding: Compare ports, not interfaces, for loop checks.
[sliver-openvswitch.git] / vswitchd / bridge.c
index 36be700..4ad7e9b 100644 (file)
@@ -1721,8 +1721,7 @@ compose_dsts(const struct bridge *br, const flow_t *flow, uint16_t vlan,
                         if (dst_is_duplicate(dsts, dst - dsts, dst)) {
                             continue;
                         }
-                        if (dst->dp_ifidx == flow->in_port
-                            && dst->vlan == vlan) {
+                        if (port == in_port && dst->vlan == vlan) {
                             /* Don't send out input port on same VLAN. */
                             continue;
                         }
@@ -2983,6 +2982,19 @@ port_update_bond_compat(struct port *port)
         memcpy(slave->mac, iface->mac, ETH_ADDR_LEN);
     }
 
+    if (cfg_get_bool(0, "bonding.%s.fake-iface", port->name)) {
+        struct netdev *bond_netdev;
+
+        if (!netdev_open(port->name, NETDEV_ETH_TYPE_NONE, &bond_netdev)) {
+            if (bond.up) {
+                netdev_turn_flags_on(bond_netdev, NETDEV_UP, true);
+            } else {
+                netdev_turn_flags_off(bond_netdev, NETDEV_UP, true);
+            }
+            netdev_close(bond_netdev);
+        }
+    }
+
     proc_net_compat_update_bond(port->name, &bond);
     free(bond.slaves);
 }