bridge: Ignore "null" interfaces as required.
authorEthan Jackson <ethan@nicira.com>
Mon, 21 May 2012 20:20:18 +0000 (13:20 -0700)
committerEthan Jackson <ethan@nicira.com>
Mon, 21 May 2012 20:20:18 +0000 (13:20 -0700)
Commit bae7208e91a0 (bridge: Refactor bridge_reconfigure().)
introduced a regression in which the switch would attempt to
instantiate "null" interfaces in the datapath. This would, of
course, fail and trigger a warning.  Though harmless, these
warnings confused users.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
vswitchd/bridge.c

index 13eb80b..0c78f94 100644 (file)
@@ -2545,11 +2545,12 @@ bridge_add_del_ports(struct bridge *br,
         for (i = 0; i < port->n_interfaces; i++) {
             const struct ovsrec_interface *cfg = port->interfaces[i];
             struct iface *iface = iface_lookup(br, cfg->name);
+            const char *type = iface_get_type(cfg, br->cfg);
 
             if (iface) {
                 iface->cfg = cfg;
-                iface->type = iface_get_type(cfg, br->cfg);
-            } else {
+                iface->type = type;
+            } else if (strcmp(type, "null")) {
                 bridge_queue_if_cfg(br, cfg, port);
             }
         }