From: kn Date: Tue, 2 Nov 2021 23:36:43 +0000 (+0000) Subject: Return non-zero on failed "nwkey" command X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ccd2b0c096acc68ae6f70e0561c6c95cfcaf37d1;p=openbsd 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 --- 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 */