Skip to content

Commit

Permalink
ovs-vsctl: Verify VLAN bridge controllers in cmd_get_controller().
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
blp committed Apr 19, 2012
1 parent d655c72 commit 7da6c3a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utilities/ovs-vsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}

Expand All @@ -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. */
Expand Down

0 comments on commit 7da6c3a

Please sign in to comment.