From bfc6f79b96a6ce78c9ab57454d94ba983adb81a8 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Wed, 3 Aug 2016 13:31:13 +0200
Subject: [PATCH] Revert "fix ip -force -batch to continue on errors"
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1288042
This reverts commit 03f8f5811ebc0f8fac1c3ccb76c14007d250bd38.
---
bridge/fdb.c | 6 +++---
bridge/link.c | 18 +++++++++---------
bridge/mdb.c | 8 ++++----
bridge/vlan.c | 4 ++--
ip/iproute.c | 2 +-
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index 6dc3153..0191c76 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -287,7 +287,7 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
if (d == NULL || addr == NULL) {
fprintf(stderr, "Device and address are required arguments.\n");
- return -1;
+ exit(-1);
}
/* Assume self */
@@ -302,7 +302,7 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
abuf, abuf+1, abuf+2,
abuf+3, abuf+4, abuf+5) != 6) {
fprintf(stderr, "Invalid mac address %s\n", addr);
- return -1;
+ exit(-1);
}
addattr_l(&req.n, sizeof(req), NDA_LLADDR, abuf, ETH_ALEN);
@@ -330,7 +330,7 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
}
if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
- return -1;
+ exit(2);
return 0;
}
diff --git a/bridge/link.c b/bridge/link.c
index 02777d6..861100d 100644
--- a/bridge/link.c
+++ b/bridge/link.c
@@ -268,19 +268,19 @@ static int brlink_modify(int argc, char **argv)
} else if (strcmp(*argv, "guard") == 0) {
NEXT_ARG();
if (!on_off("guard", &bpdu_guard, *argv))
- return -1;
+ exit(-1);
} else if (strcmp(*argv, "hairpin") == 0) {
NEXT_ARG();
if (!on_off("hairping", &hairpin, *argv))
- return -1;
+ exit(-1);
} else if (strcmp(*argv, "fastleave") == 0) {
NEXT_ARG();
if (!on_off("fastleave", &fast_leave, *argv))
- return -1;
+ exit(-1);
} else if (strcmp(*argv, "root_block") == 0) {
NEXT_ARG();
if (!on_off("root_block", &root_block, *argv))
- return -1;
+ exit(-1);
} else if (strcmp(*argv, "cost") == 0) {
NEXT_ARG();
cost = atoi(*argv);
@@ -299,7 +299,7 @@ static int brlink_modify(int argc, char **argv)
if (state == nstates) {
fprintf(stderr,
"Error: invalid STP port state\n");
- return -1;
+ exit(-1);
}
}
} else if (strcmp(*argv, "hwmode") == 0) {
@@ -313,7 +313,7 @@ static int brlink_modify(int argc, char **argv)
fprintf(stderr,
"Mode argument must be \"vepa\" or "
"\"veb\".\n");
- return -1;
+ exit(-1);
}
} else {
usage();
@@ -322,14 +322,14 @@ static int brlink_modify(int argc, char **argv)
}
if (d == NULL) {
fprintf(stderr, "Device is a required argument.\n");
- return -1;
+ exit(-1);
}
req.ifm.ifi_index = ll_name_to_index(d);
if (req.ifm.ifi_index == 0) {
fprintf(stderr, "Cannot find bridge device \"%s\"\n", d);
- return -1;
+ exit(-1);
}
/* Nested PROTINFO attribute. Contains: port flags, cost, priority and
@@ -377,7 +377,7 @@ static int brlink_modify(int argc, char **argv)
}
if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
- return -1;
+ exit(2);
return 0;
}
diff --git a/bridge/mdb.c b/bridge/mdb.c
index 821f575..1cd03e0 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -145,12 +145,12 @@ static int mdb_show(int argc, char **argv)
if (rtnl_wilddump_request(&rth, PF_BRIDGE, RTM_GETMDB) < 0) {
perror("Cannot send dump request");
- return -1;
+ exit(1);
}
if (rtnl_dump_filter(&rth, print_mdb, stdout) < 0) {
fprintf(stderr, "Dump terminated\n");
- return -1;
+ exit(1);
}
return 0;
@@ -198,7 +198,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv)
if (d == NULL || grp == NULL || p == NULL) {
fprintf(stderr, "Device, group address and port name are required arguments.\n");
- return -1;
+ exit(-1);
}
req.bpm.ifindex = ll_name_to_index(d);
@@ -225,7 +225,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv)
addattr_l(&req.n, sizeof(req), MDBA_SET_ENTRY, &entry, sizeof(entry));
if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
- return -1;
+ exit(2);
return 0;
}
diff --git a/bridge/vlan.c b/bridge/vlan.c
index b471bf7..54e10d0 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -69,7 +69,7 @@ static int vlan_modify(int cmd, int argc, char **argv)
if (d == NULL || vid == -1) {
fprintf(stderr, "Device and VLAN ID are required arguments.\n");
- return -1;
+ exit(-1);
}
req.ifm.ifi_index = ll_name_to_index(d);
@@ -96,7 +96,7 @@ static int vlan_modify(int cmd, int argc, char **argv)
addattr_nest_end(&req.n, afspec);
if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
- return -1;
+ exit(2);
return 0;
}
diff --git a/ip/iproute.c b/ip/iproute.c
index 378bdba..b7057b3 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1083,7 +1083,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, NULL, 0) < 0)
- return -1;
+ exit(2);
return 0;
}
--
1.8.3.1