[PATCH 33/44] STA: avoid driver warning when configuring not connected STAs for WPA

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

 



From: Michael Braun <michael-dev@xxxxxxxxxxxxx>

Signed-off-by: Michael Braun <michael-dev@xxxxxxxxxxxxx>
---
 src/ap/sta_info.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index e5976f9..a3ff592 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -994,11 +994,21 @@ skip_counting:
 	if (wpa_auth_sta_set_vlan(sta->wpa_sm, sta->vlan_id) < 0)
 		wpa_printf(MSG_INFO, "Failed to update VLAN-ID for WPA");
 
-	ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr, sta->vlan_id);
-	if (ret < 0) {
+	if (sta->flags & (WLAN_STA_AUTH | WLAN_STA_ASSOC)) {
+		ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr,
+					       sta->vlan_id);
+		if (ret < 0)
+			hostapd_logger(hapd, sta->addr,
+				       HOSTAPD_MODULE_IEEE80211,
+				       HOSTAPD_LEVEL_WARNING, "could not bind "
+				       "the STA entry to vlan_id=%d",
+				       sta->vlan_id);
+	} else {
+		ret = -1;
 		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
-			       HOSTAPD_LEVEL_DEBUG, "could not bind the STA "
-			       "entry to vlan_id=%d", sta->vlan_id);
+			       HOSTAPD_LEVEL_INFO, "station not authenticated, "
+			       "so skip setting vlan to vlan_id=%d",
+			       sta->vlan_id);
 	}
 
 	/* During 1x reauth, if the vlan id changes, then remove the old id. */
-- 
1.9.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