Inconsistent behaviour with duplicate dictionary entries
(freeradius 2.1.12) I have noticed an inconsistency when there are duplicate dictionary entries for the same attribute, in particular this one from dictionary.redback: ATTRIBUTE Qos-Policy-Metering 88 string ATTRIBUTE Qos-Metering-Profile-Name 88 string When radtest/radclient is decoding response packets it uses the second entry (this makes sense, it's the last entry read which takes precedence). However the debug output from freeradius -X displays the first entry instead. Example: $ echo -e 'User-Name = "foo@example.com"\nCalling-Station-Id="12345678"\nNAS-IP-Address=255.255.255.244\n' | radclient localhost auth testing123 Received response ID 166, code 2, length = 68 Qos-Metering-Profile-Name = "24M_P" Double-Authentication = 1 but freeradius -X shows: ... Sending Access-Accept of id 67 to 127.0.0.1 port 42234 Qos-Policy-Metering := "24M_P" Double-Authentication := 1 Finished request 0. Going to the next request Waking up in 4.9 seconds. Cleaning up request 0 ID 67 with timestamp +2 This is only significant because I have a GUI wrapper with a radtest function which displays the debug output. This uses the control socket to inject the packet, so I get slightly different output from freeradius -X, but it also shows the first dictionary entry: ... Injected Access-Accept packet to host 127.0.0.1 port 0 code=2, id=3 Qos-Policy-Metering := "24M_P" Double-Authentication := 1 Finished request 3. Going to the next request Thread 44 waiting to be assigned a request Anyway, this suggests to me that there may be two different code paths for looking up attribute numbers to names; maybe they could be unified? Regards, Brian.
Brian Candler wrote:
Anyway, this suggests to me that there may be two different code paths for looking up attribute numbers to names; maybe they could be unified?
There's only one... dict_attrbyvalue(). It gets the name by looking up an attribute by value. If you put the name in a file for input into "radtest", that name is used when printing the attribute. After all, it's the name you told it to use. I think that's the only confusion. Alan DeKok.
On Wed, Aug 01, 2012 at 03:59:39PM -0700, Alan DeKok wrote:
Brian Candler wrote:
Anyway, this suggests to me that there may be two different code paths for looking up attribute numbers to names; maybe they could be unified?
There's only one... dict_attrbyvalue(). It gets the name by looking up an attribute by value.
If you put the name in a file for input into "radtest", that name is used when printing the attribute. After all, it's the name you told it to use.
In fact it was a reply attribute from the server, but I now understand what you mean. If mysql updates the reply packet with 'Foo-Attribute', ':=', 'bar' then then freeradius -X always shows Foo-Attribute because this is the content of vp->name prior to encoding the packet. Once it has been encoded, sent over the wire and decoded by radclient, radclient will show the preferred dictionary name for that particular attribute. Thanks, Brian.
participants (2)
-
Alan DeKok -
Brian Candler