diff mbox

[2/6] Fix RSN preauthentification with dynamic_vlan enabled but unused

Message ID 1428670190-22671-3-git-send-email-michael-dev@fami-braun.de
State Accepted
Headers show

Commit Message

michael-dev April 10, 2015, 12:49 p.m. UTC
This fixes test test_pmksa_cache_preauth_vlan_enabled.

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

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
---
 src/ap/sta_info.h   | 2 +-
 src/radius/radius.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
index 57551ab..d8d59cb 100644
--- a/src/ap/sta_info.h
+++ b/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_probe; /* SSID selection based on ProbeReq */
 
-	int vlan_id;
+	int vlan_id; /* 0: none, >0: VID */
 	 /* PSKs from RADIUS authentication server */
 	struct hostapd_sta_wpa_psk_short *psk;
 
diff --git a/src/radius/radius.c b/src/radius/radius.c
index 8d878a4..08f0aff 100644
--- a/src/radius/radius.c
+++ b/src/radius/radius.c
@@ -1425,7 +1425,7 @@  struct radius_tunnel_attrs {
 /**
  * radius_msg_get_vlanid - Parse RADIUS attributes for VLAN tunnel information
  * @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 of 0 if none is found
  */
 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 -1;
+	return 0;
 }