From 69fdadb1a9528ffb1a800ebd6997c826e55df972 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Tue, 29 Nov 2011 13:22:18 -0800 Subject: [PATCH] lacp: Require non-zero system ID. It's a bug if LACP is configured with a system ID of zero. This patch assert fails in this case. --- lib/lacp.c | 2 ++ vswitchd/bridge.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/lib/lacp.c b/lib/lacp.c index 22cba942..6ee55c36 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -224,6 +224,8 @@ lacp_destroy(struct lacp *lacp) void lacp_configure(struct lacp *lacp, const struct lacp_settings *s) { + assert(!eth_addr_is_zero(s->id)); + if (!lacp->name || strcmp(s->name, lacp->name)) { free(lacp->name); lacp->name = xstrdup(s->name); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 85cc79e6..f79b69cd 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2677,6 +2677,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")); -- 2.30.2