hex is not working in 4.0.x
hex conversion of mac address used to work previously, (0) EXPAND 0x%{hex:%{DHCP-Client-Hardware-Address}} (0) EXPAND %{DHCP-Client-Hardware-Address} (0) --> 00:a0:bc:6c:7e:4e (0) EXPAND %{hex:%{DHCP-Client-Hardware-Address}} (0) (%{hex:00:a0:bc:6c:7e:4e}) (0) --> 00a0bc6c7e4e (0) --> 0x00a0bc6c7e4e Now it is broken, (0) EXPAND 0x%{hex:%{DHCP-Client-Hardware-Address}} (0) EXPAND %{DHCP-Client-Hardware-Address} (0) --> 00:a0:bc:6c:7d:3a (0) EXPAND %{hex:%{DHCP-Client-Hardware-Address}} (0) (%{hex:00:a0:bc:6c:7d:3a}) (0) --> 000000000000 (0) --> 0x000000000000 Regards, Nagamani Chinnapaiyan
On Dec 16, 2019, at 5:37 AM, Chinnapaiyan, Nagamani <Nagamani.Chinnapaiyan@viasat.com> wrote:
hex conversion of mac address used to work previously,
(0) EXPAND 0x%{hex:%{DHCP-Client-Hardware-Address}}
That should work, but it's also not necessary. You can just copy anything to an "octets" type, and it will work: update request { Tmp-Octets-0 := &DHCP-Client-Hardware-Address } And then the Tmp-Octets-0 can be printed, etc as hex. We'll look into this issue and push a fix. Alan DeKok.
Now it is broken,
(0) EXPAND 0x%{hex:%{DHCP-Client-Hardware-Address}}
(0) EXPAND %{DHCP-Client-Hardware-Address}
(0) --> 00:a0:bc:6c:7d:3a
(0) EXPAND %{hex:%{DHCP-Client-Hardware-Address}}
(0) (%{hex:00:a0:bc:6c:7d:3a})
(0) --> 000000000000
(0) --> 0x000000000000
Sorry about that. There was even a unit test explicitly testing this type of call to the hex xlat, but unfortunately there was an issue with the test utility. I've pushed a fix, it should be fine now. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (3)
-
Alan DeKok -
Arran Cudbard-Bell -
Chinnapaiyan, Nagamani