ovs-vsctl: Verify correct record in cmd_get_fail_mode() for VLAN bridges.
authorBen Pfaff <blp@nicira.com>
Tue, 17 Apr 2012 20:44:51 +0000 (13:44 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 19 Apr 2012 19:53:47 +0000 (12:53 -0700)
A VLAN bridge uses its parent's fail-mode, so checking the fail-mode should
verify the parent's bridge record.

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 <blp@nicira.com>
utilities/ovs-vsctl.c

index a5bd64741af72299f05b675260344c1c0b521a49..567defb18db4b53d264dfb442bb833740aca2c2d 100644 (file)
@@ -2071,9 +2071,8 @@ cmd_get_fail_mode(struct vsctl_context *ctx)
     get_info(ctx, &info);
     br = find_bridge(&info, ctx->argv[1], true);
 
-    if (br->br_cfg) {
-        ovsrec_bridge_verify_fail_mode(br->br_cfg);
-    }
+    ovsrec_bridge_verify_fail_mode(br->br_cfg
+                                   ? br->br_cfg : br->parent->br_cfg);
     if (br->fail_mode && strlen(br->fail_mode)) {
         ds_put_format(&ctx->output, "%s\n", br->fail_mode);
     }