tc: fix a misleading failure

Before this patch:

 # ./tc/tc actions add action drop index 11
 RTNETLINK answers: File exists
 We have an error talking to the kernel
 Command "(null)" is unknown, try "tc actions help".

After this patch:

 # ./tc/tc actions add action drop index 11
 RTNETLINK answers: File exists
 We have an error talking to the kernel

Cc: Stephen Hemminger <shemming@brocade.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
This commit is contained in:
WANG Cong 2016-08-08 16:24:45 -07:00 committed by Stephen Hemminger
parent 592990ebf4
commit 6fcf36c9c6
1 changed files with 3 additions and 5 deletions

View File

@ -623,14 +623,12 @@ int do_action(int argc, char **argv)
act_usage();
return -1;
} else {
ret = -1;
}
if (ret < 0) {
fprintf(stderr, "Command \"%s\" is unknown, try \"tc actions help\".\n", *argv);
return -1;
}
if (ret < 0)
return -1;
}
return 0;