ifconfig(8): Make lagg creation more fault-tolerant

Operating Systems / DragonFlyBSD - Aaron LI [aaronly.me] - 26 June 2020 14:52 UTC

- 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.

Obtained from FreeBSD: https://github.com/freebsd/freebsd/commit/dde41c97866152e8c7eb1f52f07e3e5ac43b2652 https://reviews.freebsd.org/D15046

598a666bcc ifconfig(8): Make lagg creation more fault-tolerant
sbin/ifconfig/ifclone.c | 5 +++--
sbin/ifconfig/ifconfig.c | 5 +++--
sbin/ifconfig/ifconfig.h | 1 +
sbin/ifconfig/ifgroup.c | 4 ++--
sbin/ifconfig/iflagg.c | 14 +++++++++++---
5 files changed, 20 insertions(+), 9 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share