[ovs-discuss] [PATCH] vswitchd: Fix logged warnings for new internal ports.

Ben Pfaff blp at nicira.com
Wed Aug 5 23:34:44 UTC 2009


Justin reported that adding an internal port to a bridge caused
ovs-vswitchd to log a pair of warnings.  This commit suppresses those
warnings, which were harmless.
---
 vswitchd/bridge.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index a4a723a..cbe132c 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3009,8 +3009,17 @@ iface_create(struct port *port, const char *name)
     iface->tag = tag_create_random();
     iface->delay_expires = LLONG_MAX;
 
-    netdev_nodev_get_etheraddr(name, iface->mac);
-    netdev_nodev_get_carrier(name, &iface->enabled);
+    if (!cfg_get_bool(0, "iface.%s.internal", iface->name)) {
+        netdev_nodev_get_etheraddr(name, iface->mac);
+        netdev_nodev_get_carrier(name, &iface->enabled);
+    } else {
+        /* The network device doesn't exist yet.  It will be created by the
+         * call to dpif_port_add() in bridge_reconfigure().  Until then, we
+         * can't obtain any information about it.  (There's no real value in
+         * doing so, anyway, because the 'mac' and 'enabled' values are only
+         * used for interfaces that are bond slaves, and it doesn't normally
+         * make sense to bond an internal interface.) */
+    }
 
     if (port->n_ifaces >= port->allocated_ifaces) {
         port->ifaces = x2nrealloc(port->ifaces, &port->allocated_ifaces,
-- 
1.6.3.3





More information about the discuss mailing list