ovs-dpctl: Parse the arguments correctly for del-flow.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 23 Sep 2013 20:11:41 +0000 (13:11 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Tue, 24 Sep 2013 22:57:28 +0000 (15:57 -0700)
Inside dpctl_del_flow() argv[0] is 'del-flow' and argv[1] can
be the flow in the absence of the optional datapath argument.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
utilities/ovs-dpctl.c

index be94f0b..43c0db6 100644 (file)
@@ -855,7 +855,7 @@ dpctl_del_flow(int argc, char *argv[])
     ofpbuf_init(&mask, 0);
     run(odp_flow_from_string(key_s, NULL, &key, &mask), "parsing flow key");
 
-    dp_name = argc == 2 ? xstrdup(argv[1]) : get_one_dp();
+    dp_name = argc == 3 ? xstrdup(argv[1]) : get_one_dp();
     run(parsed_dpif_open(dp_name, false, &dpif), "opening datapath");
     free(dp_name);