aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-10-26 11:39:46 -0700
committerEthan Jackson <ethan@nicira.com>2011-10-26 11:50:56 -0700
commit06b592bcbe2e5a435589b0ce3d77530756c20572 (patch)
treeb0e3bb633d5b7edcdb9acf8ad3fe90c668f2857e /vswitchd
parentb6a9a95b546e06ace34a9c878d34e1c720ed57e5 (diff)
vswitch: Don't update STP on synthetic ports.
This can cause ovs-vswitchd to crash. Bug #8007. Reported-by: Krishna Miriyala <krishna@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 3a192350..09696d5a 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -184,6 +184,7 @@ static struct lacp_settings *port_configure_lacp(struct port *,
struct lacp_settings *);
static void port_configure_bond(struct port *, struct bond_settings *,
uint32_t *bond_stable_ids);
+static bool port_is_synthetic(const struct port *);
static void bridge_configure_mirrors(struct bridge *);
static struct mirror *mirror_create(struct bridge *,
@@ -1600,6 +1601,10 @@ port_refresh_stp_status(struct port *port)
char *keys[4], *values[4];
size_t i;
+ if (port_is_synthetic(port)) {
+ return;
+ }
+
/* STP doesn't currently support bonds. */
if (!list_is_singleton(&port->ifaces)) {
ovsrec_port_set_status(port->cfg, NULL, NULL, 0);
@@ -2697,6 +2702,14 @@ port_configure_bond(struct port *port, struct bond_settings *s,
netdev_set_miimon_interval(iface->netdev, miimon_interval);
}
}
+
+/* Returns true if 'port' is synthetic, that is, if we constructed it locally
+ * instead of obtaining it from the database. */
+static bool
+port_is_synthetic(const struct port *port)
+{
+ return ovsdb_idl_row_is_synthetic(&port->cfg->header_);
+}
/* Interface functions. */