naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0024-ip-fix-exit-code-for-addrlabel.patch

049c96
From 205034e561dbc0e1fa380970130b28188870c265 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Thu, 18 Feb 2016 14:05:42 +0100
049c96
Subject: [PATCH] ip: fix exit code for addrlabel
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1288042
049c96
Upstream Status: iproute2.git commit 906cafe3ff7a3
049c96
049c96
commit 906cafe3ff7a3e285e59f95e7b58c91610d5d16f
049c96
Author: Stephen Hemminger <shemming@brocade.com>
049c96
Date:   Wed May 6 09:55:07 2015 -0700
049c96
049c96
    ip: fix exit code for addrlabel
049c96
049c96
    The exit code for ip label was not correct.
049c96
    The return from the command function is negated and turned into
049c96
    the exit code on failure.
049c96
---
049c96
 ip/ipaddrlabel.c | 6 +++---
049c96
 1 file changed, 3 insertions(+), 3 deletions(-)
049c96
049c96
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
049c96
index 8a4afbc..5b1f6e4 100644
049c96
--- a/ip/ipaddrlabel.c
049c96
+++ b/ip/ipaddrlabel.c
049c96
@@ -184,7 +184,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
049c96
 		req.ifal.ifal_family = AF_INET6;
049c96
 
049c96
 	if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
049c96
-		return 2;
049c96
+		return -2;
049c96
 
049c96
 	return 0;
049c96
 }
049c96
@@ -233,12 +233,12 @@ static int ipaddrlabel_flush(int argc, char **argv)
049c96
 
049c96
 	if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
049c96
 		perror("Cannot send dump request");
049c96
-		return 1;
049c96
+		return -1;
049c96
 	}
049c96
 
049c96
 	if (rtnl_dump_filter(&rth, flush_addrlabel, NULL) < 0) {
049c96
 		fprintf(stderr, "Flush terminated\n");
049c96
-		return 1;
049c96
+		return -1;
049c96
 	}
049c96
 
049c96
 	return 0;
049c96
-- 
049c96
1.8.3.1
049c96