summaryrefslogtreecommitdiff
path: root/lib/dpctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dpctl.c')
-rw-r--r--lib/dpctl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/dpctl.c b/lib/dpctl.c
index d12d9b8a5..970373389 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -1713,10 +1713,16 @@ dpctl_flush_conntrack(int argc, const char *argv[],
uint16_t zone, *pzone = NULL;
int error;
int args = argc - 1;
+ int zone_pos = 1;
+
+ if (dp_arg_exists(argc, argv)) {
+ args--;
+ zone_pos = 2;
+ }
/* Parse zone. */
- if (args && !strncmp(argv[1], "zone=", 5)) {
- if (!ovs_scan(argv[1], "zone=%"SCNu16, &zone)) {
+ if (args && !strncmp(argv[zone_pos], "zone=", 5)) {
+ if (!ovs_scan(argv[zone_pos], "zone=%"SCNu16, &zone)) {
ds_put_cstr(&ds, "failed to parse zone");
error = EINVAL;
goto error;
@@ -1744,7 +1750,7 @@ dpctl_flush_conntrack(int argc, const char *argv[],
}
/* Report error if there is more than one unparsed argument. */
- if (args > 1) {
+ if (args > 0) {
ds_put_cstr(&ds, "invalid arguments");
error = EINVAL;
goto error;