]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: fix a misleading failure
authorWANG Cong <xiyou.wangcong@gmail.com>
Mon, 8 Aug 2016 23:24:45 +0000 (16:24 -0700)
committerStephen Hemminger <shemming@brocade.com>
Tue, 9 Aug 2016 18:18:14 +0000 (11:18 -0700)
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>
tc/m_action.c

index 24f8b5d855211891638eb764f8e140bbd0800aec..bb19df8823b5f76662e02304aad5890c971cb5e0 100644 (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;