From 205034e561dbc0e1fa380970130b28188870c265 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Thu, 18 Feb 2016 14:05:42 +0100
Subject: [PATCH] ip: fix exit code for addrlabel
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1288042
Upstream Status: iproute2.git commit 906cafe3ff7a3
commit 906cafe3ff7a3e285e59f95e7b58c91610d5d16f
Author: Stephen Hemminger <shemming@brocade.com>
Date: Wed May 6 09:55:07 2015 -0700
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.
---
ip/ipaddrlabel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index 8a4afbc..5b1f6e4 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -184,7 +184,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;
}
@@ -233,12 +233,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;
--
1.8.3.1