aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemming@brocade.com>2015-05-06 09:55:07 -0700
committerStephen Hemminger <shemming@brocade.com>2015-05-07 08:11:30 -0700
commit906cafe3ff7a3e285e59f95e7b58c91610d5d16f (patch)
treefdf0627b9f1a3b55e17690216904e0721875cdef
parent076ae7089a4b4874a1aedd4c5f84bb889dcda34e (diff)
downloadplatform_external_iproute2-906cafe3ff7a3e285e59f95e7b58c91610d5d16f.tar.gz
platform_external_iproute2-906cafe3ff7a3e285e59f95e7b58c91610d5d16f.tar.bz2
platform_external_iproute2-906cafe3ff7a3e285e59f95e7b58c91610d5d16f.zip
ip: fix exit code for addrlabel
The exit code for ip label was not correct. The return from the command function is negated and turned into the exit code on failure.
-rw-r--r--ip/ipaddrlabel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index f6a638b5..19a93083 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -183,7 +183,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
req.ifal.ifal_family = AF_INET6;
if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
- return 2;
+ return -2;
return 0;
}
@@ -232,12 +232,12 @@ static int ipaddrlabel_flush(int argc, char **argv)
if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
perror("Cannot send dump request");
- return 1;
+ return -1;
}
if (rtnl_dump_filter(&rth, flush_addrlabel, NULL) < 0) {
fprintf(stderr, "Flush terminated\n");
- return 1;
+ return -1;
}
return 0;