[ovs-dev] [bond 4/7] lacp: Enforce valid lacp-system-id configuration.

Ethan Jackson ethan at nicira.com
Thu Jan 12 19:40:01 UTC 2012


With this patch, when a user attempts to configure LACP with an
invalid system ID, OVS will fail to create the bond and warn.
This behavior seems safer then defaulting to the bridge Ethernet
Address which may surprise users.

Bug #8710.
Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
 vswitchd/bridge.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index b45b972..4614ea1 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2664,9 +2664,14 @@ port_configure_lacp(struct port *port, struct lacp_settings *s)
     s->name = port->name;
 
     system_id = get_port_other_config(port->cfg, "lacp-system-id", NULL);
-    if (!system_id
-        || sscanf(system_id, ETH_ADDR_SCAN_FMT,
-                  ETH_ADDR_SCAN_ARGS(s->id)) != ETH_ADDR_SCAN_COUNT) {
+    if (system_id) {
+        if (sscanf(system_id, ETH_ADDR_SCAN_FMT,
+                   ETH_ADDR_SCAN_ARGS(s->id)) != ETH_ADDR_SCAN_COUNT) {
+            VLOG_WARN("port %s: LACP system ID (%s) must be an Ethernet"
+                      " Address.", port->name, system_id);
+            return NULL;
+        }
+    } else {
         memcpy(s->id, port->bridge->ea, ETH_ADDR_LEN);
     }
 
-- 
1.7.7.1




More information about the dev mailing list