Browse Source

Fix RSN preauthentication with dynamic_vlan enabled but unused

sta->vlan_id == -1 means no VLAN, as does vlan_id = 0.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Michael Braun 10 years ago
parent
commit
3ffdeb7ac8
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/ap/sta_info.h
  2. 2 2
      src/radius/radius.c

+ 1 - 1
src/ap/sta_info.h

@@ -120,7 +120,7 @@ struct sta_info {
 	struct hostapd_ssid *ssid; /* SSID selection based on (Re)AssocReq */
 	struct hostapd_ssid *ssid; /* SSID selection based on (Re)AssocReq */
 	struct hostapd_ssid *ssid_probe; /* SSID selection based on ProbeReq */
 	struct hostapd_ssid *ssid_probe; /* SSID selection based on ProbeReq */
 
 
-	int vlan_id;
+	int vlan_id; /* 0: none, >0: VID */
 	 /* PSKs from RADIUS authentication server */
 	 /* PSKs from RADIUS authentication server */
 	struct hostapd_sta_wpa_psk_short *psk;
 	struct hostapd_sta_wpa_psk_short *psk;
 
 

+ 2 - 2
src/radius/radius.c

@@ -1425,7 +1425,7 @@ struct radius_tunnel_attrs {
 /**
 /**
  * radius_msg_get_vlanid - Parse RADIUS attributes for VLAN tunnel information
  * radius_msg_get_vlanid - Parse RADIUS attributes for VLAN tunnel information
  * @msg: RADIUS message
  * @msg: RADIUS message
- * Returns: VLAN ID for the first tunnel configuration of -1 if none is found
+ * Returns: VLAN ID for the first tunnel configuration or 0 if none is found
  */
  */
 int radius_msg_get_vlanid(struct radius_msg *msg)
 int radius_msg_get_vlanid(struct radius_msg *msg)
 {
 {
@@ -1488,7 +1488,7 @@ int radius_msg_get_vlanid(struct radius_msg *msg)
 			return tun->vlanid;
 			return tun->vlanid;
 	}
 	}
 
 
-	return -1;
+	return 0;
 }
 }