diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2021-11-02 23:36:44 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2021-11-02 23:36:44 +0000 |
commit | 3c6752ef9b9c9f25e7a65d8a0fa73a8ced6b0c57 (patch) | |
tree | 52525b90a5e1bdd6829f83f9ea60c585f9a8071c /sbin/ifconfig | |
parent | 22fab3bc838428b3c73dd721cb0dddcafb6da74c (diff) |
Return non-zero on failed "nwkey" command
Fail early and exit non-zero immediately instead of indicating success and
possibly carrying the next ifconfig command.
Found at install when wifi interfaces are reset with "-nwid -nwkey -wpa":
Which network interface do you wish to configure? (or 'done') [bse0] bwfm0
ifconfig: SIOCS80211NWKEY: Operation not supported by device
Access point? (ESSID, 'any', list# or '?') [any] 2
Security protocol? (O)pen, (W)EP, WPA-(P)SK [O]
bwfm(4) currently does not support WEP.
OK stsp
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index c603c3837fc..53177a173a6 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.445 2021/10/06 06:14:08 florian Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.446 2021/11/02 23:36:43 kn Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -2033,7 +2033,7 @@ setifnwkey(const char *val, int d) } if (ioctl(sock, SIOCS80211NWKEY, (caddr_t)&nwkey) == -1) - warn("SIOCS80211NWKEY"); + err("SIOCS80211NWKEY"); } /* ARGSUSED */ |