ifconfig(8): Make lagg creation more fault-tolerant
authorAaron LI <aly@aaronly.me>
Sun, 12 Apr 2020 13:29:32 +0000 (21:29 +0800)
committerAaron LI <aly@aaronly.me>
Fri, 26 Jun 2020 14:52:59 +0000 (22:52 +0800)
commit598a666bccff5d91ec5bc75a130e6b7d19147d49
treea58c719ab7429b0025af11fa65bc64d50ca3d7d1
parentd5e6c24f77ac1154d7c486381fc10f51c2d9e087
ifconfig(8): 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.

Obtained from FreeBSD:
https://github.com/freebsd/freebsd/commit/dde41c97866152e8c7eb1f52f07e3e5ac43b2652
https://reviews.freebsd.org/D15046
sbin/ifconfig/ifclone.c
sbin/ifconfig/ifconfig.c
sbin/ifconfig/ifconfig.h
sbin/ifconfig/ifgroup.c
sbin/ifconfig/iflagg.c