aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifgroup.c
diff options
context:
space:
mode:
authorAndrew Gallatin <gallatin@FreeBSD.org>2018-04-17 12:54:58 +0000
committerAndrew Gallatin <gallatin@FreeBSD.org>2018-04-17 12:54:58 +0000
commit47528c67efac952d08840ed54f0b93682a6008a8 (patch)
tree336edcf624b6517b2aa0993c5a80723e46c561ee /sbin/ifconfig/ifgroup.c
parent604f1c416c128565923d63ab4cd98d1a7ced0cf4 (diff)
downloadsrc-47528c67efac952d08840ed54f0b93682a6008a8.tar.gz
src-47528c67efac952d08840ed54f0b93682a6008a8.zip
Make lagg creation more fault tolerant
- Warn, don't exit, when SIOCSLAGGPORT returns an error. When we exit with an error during lagg creation, a single failed NIC (which no longer attaches) can prevent lagg creation and other configuration, such as adding an IPv4 address, and thus leave a machine unreachable. - Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT, in case scripts are looking for it. Hopefully this can be extended if other parts of ifconfig can allow a "soft" failure. - Improve the warning message to mention what lagg and what member are problematic. Reviewed by: jtl, glebius Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15046
Notes
Notes: svn path=/head/; revision=332645
Diffstat (limited to 'sbin/ifconfig/ifgroup.c')
-rw-r--r--sbin/ifconfig/ifgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifgroup.c b/sbin/ifconfig/ifgroup.c
index d3792e00a1cb..106d1260ef18 100644
--- a/sbin/ifconfig/ifgroup.c
+++ b/sbin/ifconfig/ifgroup.c
@@ -140,7 +140,7 @@ printgroup(const char *groupname)
if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {
if (errno == EINVAL || errno == ENOTTY ||
errno == ENOENT)
- exit(0);
+ exit(exit_code);
else
err(1, "SIOCGIFGMEMB");
}
@@ -159,7 +159,7 @@ printgroup(const char *groupname)
}
free(ifgr.ifgr_groups);
- exit(0);
+ exit(exit_code);
}
static struct cmd group_cmds[] = {