[PATCH V2 2/8] AP: Don't try to set NULL WEP default key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hostapd_broadcast_wep_set() can be called without a WEP key set.
Don't try to install a default key in that case.

Signed-off-by: Alexander Wetzel <alexander@xxxxxxxxxxxxxx>
---

This patch is also not critical for the new API. With key_flag we just
would report an (ignored) error and do nothing. With the patch we simply
do nothing.

 src/ap/hostapd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a6a95debf..9e7d9c46f 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -336,6 +336,10 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd)
 	struct hostapd_ssid *ssid = &hapd->conf->ssid;
 
 	idx = ssid->wep.idx;
+
+	if (!ssid->wep.key[idx])
+		return 0;
+
 	if (ssid->wep.default_len &&
 	    hostapd_drv_set_key(hapd->conf->iface,
 				hapd, WPA_ALG_WEP, broadcast_ether_addr, idx, 0,
-- 
2.25.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux