[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gnu-radius] USR Total Control - attribute not found
From: |
Andrea Mistrali |
Subject: |
[Help-gnu-radius] USR Total Control - attribute not found |
Date: |
Wed, 2 Oct 2002 15:16:20 +0200 (CEST) |
Hi to all!
I've seen in the archives a thread about GNU Radius not supporting USR/3Com
VSA.
It has been said it could be a problem with an old dictionary. It is not a
dictionary problem, but Total Control Hubs does not follow RFCs sending VSA.
RFC says that a VSA packet should be made in this way:
1 byte for Attribute (26)
1 byte for Attribute length
4 bytes for Vendor Code (V009 for Cisco, V429 for USR/3Com, so on)
1 byte for Vendor attribute
1 byte for Vendor attribute value length
N bytes for value
USR/3Com VSA packets are made this other way:
1 byte for Attribute (26)
1 byte for Attribute length
4 bytes for Vendor Code (V429)
4 bytes for Vendor attribute
N bytes for value
I tried to hack source code to make GNU Radius work with USR Total Control and
here is the patch:
--- gnu-radius-0.96.4-nousr/radiusd/radius.c Wed Oct 2 14:58:40 2002
+++ gnu-radius-0.96.4/radiusd/radius.c Wed Oct 2 14:58:59 2002
@@ -428,10 +428,21 @@ radrecv (host, udp_port, buffer, length)
if ((vendorcode = vendor_pec_to_id (vendorpec)) != 0)
{
ptr += 4;
- attribute = *ptr | (vendorcode << 16);
- ptr += 2;
- attrlen -= 6;
- length -= 6;
+ if (vendorpec == 429)
+ { /* Hack for non-compliant USR VSA */
+ memcpy (&attribute, ptr, 4);
+ ptr += 4;
+ attribute = ntohl (attribute) | (vendorcode << 16);
+ attrlen -= 8;
+ length -= 8;
+ }
+ else
+ {
+ attribute = *ptr | (vendorcode << 16);
+ ptr += 2;
+ attrlen -= 6;
+ length -= 6;
+ }
}
}
This patch works with the USR dictionary given with GNU radius (dict/usr).
Hope to help
Andrea Mistrali
- [Help-gnu-radius] USR Total Control - attribute not found,
Andrea Mistrali <=