summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2018-02-02 13:39:53 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2018-02-02 13:39:53 +0000
commiteba5f57ba6af6d617903f29f3427213a1b3388e4 (patch)
tree2320c83b593769b7d5d6ab06ec0f6200d2f438ff /sbin
parentfdcb1e2899abe792c519563d6dc491c49db1c653 (diff)
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c4
1 files changed, 3 insertions, 1 deletions
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");
}