[PATCH] Define the NAS-Port-Id RADIUS attribute.

Nick Lowe nick.lowe at lugatech.com
Sat Feb 6 03:54:03 PST 2016


There is then a need to, subsequently, add code to actually send this
attribute in Access-Request and Accounting-Request packets, populated
with the ifname.

Related...

Correction is also needed for the NAS-Port attribute at this is
presently included with a value of 0 where the association id is not
available. Either the attribute should not be present when that occurs
(which is most of the time), or it should contain the ifindex (better)
for the virtual interface. The current implementation does not comply
with RFC 3580 by sending 0.

We need to continue to ensure and be careful that the NAS-Port value
is consistent in Access-Request and subsequent Accounting-Request
packets.

---

Define the NAS-Port-Id RADIUS attribute.

Signed-off-by: Nick Lowe <nick.lowe at lugatech.com>
---
 src/radius/radius.c | 1 +
 src/radius/radius.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/radius/radius.c b/src/radius/radius.c
index 266b29f..440f958 100644
--- a/src/radius/radius.c
+++ b/src/radius/radius.c
@@ -229,6 +229,7 @@ static const struct radius_attr_type radius_attrs[] =
   RADIUS_ATTR_HEXDUMP },
  { RADIUS_ATTR_ACCT_INTERIM_INTERVAL, "Acct-Interim-Interval",
   RADIUS_ATTR_INT32 },
+ { RADIUS_ATTR_NAS_PORT_ID, "NAS-Port-Id", RADIUS_ATTR_TEXT },
  { RADIUS_ATTR_CHARGEABLE_USER_IDENTITY, "Chargeable-User-Identity",
   RADIUS_ATTR_TEXT },
  { RADIUS_ATTR_NAS_IPV6_ADDRESS, "NAS-IPv6-Address", RADIUS_ATTR_IPV6 },
diff --git a/src/radius/radius.h b/src/radius/radius.h
index f14de53..09b674a 100644
--- a/src/radius/radius.h
+++ b/src/radius/radius.h
@@ -89,6 +89,7 @@ enum { RADIUS_ATTR_USER_NAME = 1,
        RADIUS_ATTR_MESSAGE_AUTHENTICATOR = 80,
        RADIUS_ATTR_TUNNEL_PRIVATE_GROUP_ID = 81,
        RADIUS_ATTR_ACCT_INTERIM_INTERVAL = 85,
+       RADIUS_ATTR_NAS_PORT_ID = 87,
        RADIUS_ATTR_CHARGEABLE_USER_IDENTITY = 89,
        RADIUS_ATTR_NAS_IPV6_ADDRESS = 95,
        RADIUS_ATTR_ERROR_CAUSE = 101,
-- 
2.5.0



More information about the Hostap mailing list