Patchwork [v3,10/25] VLAN: Use new VLAN data type in src_ap_pmksa_cache_auth

login
register
mail settings
Submitter michael-dev@fami-braun.de
Date July 27, 2013, 4:13 p.m.
Message ID <20130727161335.1152.16518.stgit@ray-controller>
Download mbox | patch
Permalink /patch/262471/
State Superseded
Headers show

Comments

michael-dev@fami-braun.de - July 27, 2013, 4:13 p.m.
Signed-hostap: Michael Braun <michael-dev@fami-braun.de>
---
 src/ap/pmksa_cache_auth.c |    9 ++++++---
 src/ap/pmksa_cache_auth.h |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

Patch

diff --git a/src/ap/pmksa_cache_auth.c b/src/ap/pmksa_cache_auth.c
index 40972e9..0bac0de 100644
--- a/src/ap/pmksa_cache_auth.c
+++ b/src/ap/pmksa_cache_auth.c
@@ -44,6 +44,7 @@  static void _pmksa_cache_free_entry(struct rsn_pmksa_cache_entry *entry)
 #ifndef CONFIG_NO_RADIUS
 	radius_free_class(&entry->radius_class);
 #endif /* CONFIG_NO_RADIUS */
+	vlan_free(&entry->vlan_id);
 	os_free(entry);
 }
 
@@ -143,7 +144,8 @@  static void pmksa_cache_from_eapol_data(struct rsn_pmksa_cache_entry *entry,
 #endif /* CONFIG_NO_RADIUS */
 
 	entry->eap_type_authsrv = eapol->eap_type_authsrv;
-	entry->vlan_id = ((struct sta_info *) eapol->sta)->vlan_id;
+	vlan_alloc_copy(&entry->vlan_id,
+	                &((struct sta_info *) eapol->sta)->vlan_id);
 }
 
 
@@ -180,7 +182,8 @@  void pmksa_cache_to_eapol_data(struct rsn_pmksa_cache_entry *entry,
 	}
 
 	eapol->eap_type_authsrv = entry->eap_type_authsrv;
-	((struct sta_info *) eapol->sta)->vlan_id = entry->vlan_id;
+	vlan_alloc_copy(&((struct sta_info *) eapol->sta)->vlan_id,
+	                &entry->vlan_id);
 }
 
 
@@ -314,7 +317,7 @@  pmksa_cache_add_okc(struct rsn_pmksa_cache *pmksa,
 	radius_copy_class(&entry->radius_class, &old_entry->radius_class);
 #endif /* CONFIG_NO_RADIUS */
 	entry->eap_type_authsrv = old_entry->eap_type_authsrv;
-	entry->vlan_id = old_entry->vlan_id;
+	vlan_alloc_copy(&entry->vlan_id, &old_entry->vlan_id);
 	entry->opportunistic = 1;
 
 	pmksa_cache_link_entry(pmksa, entry);
diff --git a/src/ap/pmksa_cache_auth.h b/src/ap/pmksa_cache_auth.h
index aa90024..9ebcbc4 100644
--- a/src/ap/pmksa_cache_auth.h
+++ b/src/ap/pmksa_cache_auth.h
@@ -28,7 +28,7 @@  struct rsn_pmksa_cache_entry {
 	struct wpabuf *cui;
 	struct radius_class_data radius_class;
 	u8 eap_type_authsrv;
-	int vlan_id;
+	vlan_t vlan_id;
 	int opportunistic;
 };