From ec99891dd4390e1519908c2d2759e79d5f6c40f8 Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 2 Feb 2018 13:39:52 +0000 Subject: [PATCH] Make 'ifconfig if0 wpaakms 802.1x' implicitly enable WPA. Requring WPA to be enabled separately via 'ifconfig if0 wpa' was confusing. ok mlarkin phessler mpi --- sbin/ifconfig/ifconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 4a0f4d632d2..ab1e3c918f4 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.353 2018/01/16 10:33:55 mpi Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.354 2018/02/02 13:39:52 stsp Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -1796,6 +1796,8 @@ setifwpaakms(const char *val, int d) if (ioctl(s, SIOCG80211WPAPARMS, (caddr_t)&wpa) < 0) err(1, "SIOCG80211WPAPARMS"); wpa.i_akms = rval; + /* Enable WPA for 802.1x here. PSK case is handled in setifwpakey(). */ + wpa.i_enabled = ((rval & IEEE80211_WPA_AKM_8021X) != 0); if (ioctl(s, SIOCS80211WPAPARMS, (caddr_t)&wpa) < 0) err(1, "SIOCS80211WPAPARMS"); } -- 2.20.1