ovs-vsctl: Fix segfault with fake bridges.
authorBen Pfaff <blp@nicira.com>
Thu, 17 Dec 2009 23:53:43 +0000 (15:53 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 17 Dec 2009 23:53:43 +0000 (15:53 -0800)
A fake bridge has no br_cfg, so we can't dereference it.

There is a similar problem in cmd_set_controller() and
cmd_del_controller() but this commit does not fix it.

utilities/ovs-vsctl.c

index 852db3aeea61ded61d361699e799a86df6d48f12..c60fd43398a227a252b965b833b18c726ba4aacf 100644 (file)
@@ -386,7 +386,7 @@ add_bridge(struct vsctl_info *b,
     br->name = xstrdup(name);
     br->parent = parent;
     br->vlan = vlan;
-    br->ctrl = br_cfg->controller;
+    br->ctrl = parent ? parent->br_cfg->controller : br_cfg->controller;
     shash_add(&b->bridges, br->name, br);
     return br;
 }