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