ifconfig(8): Sync with FreeBSD a bit and various cleanups
authorAaron LI <aly@aaronly.me>
Sat, 24 Mar 2018 08:56:39 +0000 (16:56 +0800)
committerAaron LI <aly@aaronly.me>
Sun, 5 Aug 2018 01:47:42 +0000 (09:47 +0800)
commit46158ff547aeb44d75edbca7a8c8ecd565aec166
tree0ba2d4f18b345a58d52cbc79b3fd5316d40b53a1
parentd4e856128472e2e79172aebf65f19f527ac0010f
ifconfig(8): Sync with FreeBSD a bit and various cleanups

* Sync ifconfig.c a bit with FreeBSD; replace several warnx() with
  errx(), and improve error messages a bit.

* Remove unnecessary exit() after Perror().

* Sync if_clone.c with FreeBSD.

* Add inclusion guard to ifconfig.h.

* Make iseq() a static function for ifieee80211.c and regdomain.c,
  replacing the duplicate definitions of it; and use iseq()
  consistently to replace strncasecmp() and strcasecmp().

* Move "struct ident" from regdomain.c to regdomain.h, and add and use
  "enum IdentType".

* Various whitespace cleanups.

* Cleanup header file inclusion: remove duplicates, and reorder a bit.

* Fix various signed vs. unsigned comparisons.

* Fix some compilation warnings, and raise WARNS to 3.
15 files changed:
sbin/ifconfig/Makefile
sbin/ifconfig/af_inet.c
sbin/ifconfig/af_inet6.c
sbin/ifconfig/af_link.c
sbin/ifconfig/ifbridge.c
sbin/ifconfig/ifcarp.c
sbin/ifconfig/ifclone.c
sbin/ifconfig/ifconfig.c
sbin/ifconfig/ifconfig.h
sbin/ifconfig/ifieee80211.c
sbin/ifconfig/iflagg.c
sbin/ifconfig/ifmedia.c
sbin/ifconfig/ifvlan.c
sbin/ifconfig/regdomain.c
sbin/ifconfig/regdomain.h