From: Ben Pfaff Date: Tue, 17 Apr 2012 20:50:53 +0000 (-0700) Subject: ovs-vsctl: Verify VLAN bridge controllers in cmd_get_controller(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7da6c3a6906872f6c98bd515490f201d430a3f97;p=openvswitch ovs-vsctl: Verify VLAN bridge controllers in cmd_get_controller(). A VLAN bridge uses its parent's controllers, so checking the controller should verify the parent's set of controllers. The change to verify_controllers() isn't necessary; it just deletes the check for a null 'bridge' because verify_controllers() can no longer be called with a null 'bridge'. This fixes a bug, but it is unlikely to ever have caused a real problem for users. Found by inspection. Signed-off-by: Ben Pfaff --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 567defb1..1e04410b 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -1947,13 +1947,11 @@ cmd_iface_to_br(struct vsctl_context *ctx) static void verify_controllers(struct ovsrec_bridge *bridge) { - if (bridge) { - size_t i; + size_t i; - ovsrec_bridge_verify_controller(bridge); - for (i = 0; i < bridge->n_controller; i++) { - ovsrec_controller_verify_target(bridge->controller[i]); - } + ovsrec_bridge_verify_controller(bridge); + for (i = 0; i < bridge->n_controller; i++) { + ovsrec_controller_verify_target(bridge->controller[i]); } } @@ -1975,6 +1973,9 @@ cmd_get_controller(struct vsctl_context *ctx) get_info(ctx, &info); br = find_bridge(&info, ctx->argv[1], true); + if (br->parent) { + br = br->parent; + } verify_controllers(br->br_cfg); /* Print the targets in sorted order for reproducibility. */