bridge: Enable support for access and native VLAN ports on bonds.
[sliver-openvswitch.git] / vswitchd / bridge.c
index 85cc79e..de773f6 100644 (file)
@@ -539,17 +539,8 @@ port_configure(struct port *port)
 
     /* Get VLAN tag. */
     s.vlan = -1;
-    if (cfg->tag) {
-        if (list_is_short(&port->ifaces)) {
-            if (*cfg->tag >= 0 && *cfg->tag <= 4095) {
-                s.vlan = *cfg->tag;
-            }
-        } else {
-            /* It's possible that bonded, VLAN-tagged ports make sense.  Maybe
-             * they even work as-is.  But they have not been tested. */
-            VLOG_WARN("port %s: VLAN tags not supported on bonded ports",
-                      port->name);
-        }
+    if (cfg->tag && *cfg->tag >= 0 && *cfg->tag <= 4095) {
+        s.vlan = *cfg->tag;
     }
 
     /* Get VLAN trunks. */
@@ -2677,6 +2668,11 @@ port_configure_lacp(struct port *port, struct lacp_settings *s)
         memcpy(s->id, port->bridge->ea, ETH_ADDR_LEN);
     }
 
+    if (eth_addr_is_zero(s->id)) {
+        VLOG_WARN("port %s: Invalid zero LACP system ID.", port->name);
+        return NULL;
+    }
+
     /* Prefer bondable links if unspecified. */
     priority = atoi(get_port_other_config(port->cfg, "lacp-system-priority",
                                           "0"));
@@ -3400,6 +3396,10 @@ collect_splinter_vlans(const struct ovsrec_open_vswitch *ovs_cfg)
     struct bridge *br;
     size_t i;
 
+    /* Free space allocated for synthesized ports and interfaces, since we're
+     * in the process of reconstructing all of them. */
+    free_registered_blocks();
+
     splinter_vlans = NULL;
     sset_init(&splinter_ifaces);
     for (i = 0; i < ovs_cfg->n_bridges; i++) {
@@ -3567,8 +3567,6 @@ add_vlan_splinter_ports(struct bridge *br,
 {
     size_t i;
 
-    free_registered_blocks();
-
     /* We iterate through 'br->cfg->ports' instead of 'ports' here because
      * we're modifying 'ports'. */
     for (i = 0; i < br->cfg->n_ports; i++) {