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

michael-dev at fami-braun.de michael-dev at fami-braun.de
Wed Feb 24 03:53:39 PST 2016


From: Michael Braun <michael-dev at fami-braun.de>

Signed-off-by: Michael Braun <michael-dev at fami-braun.de>
---
 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




More information about the Hostap mailing list