[PATCH] Send an Acct-Multi-Session-Id attribute in Access-Request packets.

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

 



Version without broken whitespace attached.

Send an Acct-Multi-Session-Id attribute in Access-Request packets.

Signed-off-by: Nick Lowe <nick.lowe@xxxxxxxxxxxx>
---
 src/ap/accounting.c | 14 --------------
 src/ap/ieee802_1x.c | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/ap/accounting.c b/src/ap/accounting.c
index 7636cfc..163b715 100644
--- a/src/ap/accounting.c
+++ b/src/ap/accounting.c
@@ -52,20 +52,6 @@ static struct radius_msg * accounting_msg(struct
hostapd_data *hapd,

     if (sta) {
         radius_msg_make_authenticator(msg, (u8 *) sta, sizeof(*sta));
-
-        if ((hapd->conf->wpa & 2) &&
-            !hapd->conf->disable_pmksa_caching &&
-            sta->eapol_sm && sta->eapol_sm->acct_multi_session_id) {
-            os_snprintf(buf, sizeof(buf), "%016lX",
-                    sta->eapol_sm->acct_multi_session_id);
-            if (!radius_msg_add_attr(
-                    msg, RADIUS_ATTR_ACCT_MULTI_SESSION_ID,
-                    (u8 *) buf, os_strlen(buf))) {
-                wpa_printf(MSG_INFO,
-                       "Could not add Acct-Multi-Session-Id");
-                goto fail;
-            }
-        }
     } else {
         radius_msg_make_authenticator(msg, (u8 *) hapd, sizeof(*hapd));
     }
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 5f95a65..6ac4379 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -448,6 +448,20 @@ static int add_common_radius_sta_attr(struct
hostapd_data *hapd,
         }
     }

+    if ((hapd->conf->wpa & 2) &&
+        !hapd->conf->disable_pmksa_caching &&
+        sta->eapol_sm && sta->eapol_sm->acct_multi_session_id) {
+        os_snprintf(buf, sizeof(buf), "%016lX",
+                sta->eapol_sm->acct_multi_session_id);
+        if (!radius_msg_add_attr(
+                msg, RADIUS_ATTR_ACCT_MULTI_SESSION_ID,
+                (u8 *) buf, os_strlen(buf))) {
+            wpa_printf(MSG_INFO,
+                   "Could not add Acct-Multi-Session-Id");
+            return -1;
+        }
+    }
+
 #ifdef CONFIG_IEEE80211R
     if (hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) &&
         sta->wpa_sm &&
-- 
2.5.0
From 056500ca62665bd780cc52279282c401211d21d8 Mon Sep 17 00:00:00 2001
From: Nick Lowe <nick.lowe@xxxxxxxxxxxx>
Date: Mon, 25 Jan 2016 16:49:59 +0000
Subject: [PATCH 9/9] Send an Acct-Multi-Session-Id attribute in Access-Request
 packets.

Signed-off-by: Nick Lowe <nick.lowe@xxxxxxxxxxxx>
---
 src/ap/accounting.c | 14 --------------
 src/ap/ieee802_1x.c | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/ap/accounting.c b/src/ap/accounting.c
index 7636cfc..163b715 100644
--- a/src/ap/accounting.c
+++ b/src/ap/accounting.c
@@ -52,20 +52,6 @@ static struct radius_msg * accounting_msg(struct hostapd_data *hapd,
 
 	if (sta) {
 		radius_msg_make_authenticator(msg, (u8 *) sta, sizeof(*sta));
-
-		if ((hapd->conf->wpa & 2) &&
-		    !hapd->conf->disable_pmksa_caching &&
-		    sta->eapol_sm && sta->eapol_sm->acct_multi_session_id) {
-			os_snprintf(buf, sizeof(buf), "%016lX",
-				    sta->eapol_sm->acct_multi_session_id);
-			if (!radius_msg_add_attr(
-				    msg, RADIUS_ATTR_ACCT_MULTI_SESSION_ID,
-				    (u8 *) buf, os_strlen(buf))) {
-				wpa_printf(MSG_INFO,
-					   "Could not add Acct-Multi-Session-Id");
-				goto fail;
-			}
-		}
 	} else {
 		radius_msg_make_authenticator(msg, (u8 *) hapd, sizeof(*hapd));
 	}
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 5f95a65..6ac4379 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -448,6 +448,20 @@ static int add_common_radius_sta_attr(struct hostapd_data *hapd,
 		}
 	}
 
+	if ((hapd->conf->wpa & 2) &&
+	    !hapd->conf->disable_pmksa_caching &&
+	    sta->eapol_sm && sta->eapol_sm->acct_multi_session_id) {
+		os_snprintf(buf, sizeof(buf), "%016lX",
+			    sta->eapol_sm->acct_multi_session_id);
+		if (!radius_msg_add_attr(
+			    msg, RADIUS_ATTR_ACCT_MULTI_SESSION_ID,
+			    (u8 *) buf, os_strlen(buf))) {
+			wpa_printf(MSG_INFO,
+				   "Could not add Acct-Multi-Session-Id");
+			return -1;
+		}
+	}
+
 #ifdef CONFIG_IEEE80211R
 	if (hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) &&
 	    sta->wpa_sm &&
-- 
2.5.0

_______________________________________________
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