]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: return correct exit code on route failure
authorStephen Hemminger <shemming@brocade.com>
Wed, 6 May 2015 16:48:06 +0000 (09:48 -0700)
committerStephen Hemminger <shemming@brocade.com>
Thu, 7 May 2015 15:11:30 +0000 (08:11 -0700)
If kernel complains about ip route request, exit status should be
2 not 1.

This fixes regression introduced by:
commit 42ecedd4bae534fc688194a795eb4548c6530cda
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
Date:   Tue Mar 17 19:26:32 2015 -0700

    fix ip -force -batch to continue on errors

ip/iproute.c

index e0a61598fc88225dfd63576a4ef1cb447445234d..06aea6ff7771ea7aee70ba62ae9e606ec236e75f 100644 (file)
@@ -1164,7 +1164,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                req.r.rtm_family = AF_INET;
 
        if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
-               return -1;
+               return -2;
 
        return 0;
 }