[master] function fr_dhcpv4_encode is badly broken

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Fri Nov 6 16:23:39 CET 2020


Likely since this commit:
https://github.com/FreeRADIUS/freeradius-server/commit/3f3afcee211407fb293186416241a149136a7464


For example, using dhcpclient:
echo "DHCP-Client-Hardware-Address=44:48:42:66:00:5a, DHCP-Transaction-Id=42, DHCP-Gateway-IP-Address=10.11.19.3, Packet-Src-Port=67, Packet-Src-IP-Address=10.11.19.3" | dhcpclient 10.11.19.28 discover


Result before (it's working, although the trace looks a bit odd: some things are displayed twice...):

Sending DHCP-Discover Id 0000002a from 10.11.19.3:67 to 10.11.19.28:67 length 300
        DHCP-Client-Hardware-Address = 44:48:42:66:00:5a
        DHCP-Transaction-Id = 42
        DHCP-Gateway-IP-Address = 10.11.19.3
        Packet-Src-Port = 67
        Packet-Src-IP-Address = 10.11.19.3
        DHCP-Opcode = Client-Message
        DHCP-Hardware-Type = Ethernet
        DHCP-Hardware-Address-Length = 6
        DHCP-Hop-Count = 0
        DHCP-Transaction-Id = 42
        DHCP-Number-of-Seconds = 0
        DHCP-Flags = 0
        DHCP-Client-IP-Address = 0.0.0.0
        DHCP-Your-IP-Address = 0.0.0.0
        DHCP-Server-IP-Address = 0.0.0.0
        DHCP-Gateway-IP-Address = 10.11.19.3
        DHCP-Client-Hardware-Address = 44:48:42:66:00:5a
        DHCP-Message-Type = DHCP-Discover
        DHCP-Network-Subnet = 10.11.19.3/32
Received DHCP-Offer Id 0000002a from 10.11.19.28:67 to 10.11.19.3:67 via eth1 length 306
(...)


Now (KO):
Some fields are wrong, for example: the first "DHCP-Gateway-IP-Address" is the value provided, but the second is reversed.
There is a "DHCP-Server-Host-Name", "DHCP-Message-Type" is missing, etc.

Sending DHCP-Discover Id 0000002a from 10.11.19.3:67 to 10.11.19.28:67 length 300
        DHCP-Client-Hardware-Address = 44:48:42:66:00:5a
        DHCP-Transaction-Id = 42
        DHCP-Gateway-IP-Address = 10.11.19.3
        Packet-Src-Port = 67
        Packet-Src-IP-Address = 10.11.19.3
        DHCP-Opcode = Client-Message
        DHCP-Hardware-Type = 0
        DHCP-Hardware-Address-Length = 0
        DHCP-Hop-Count = 0
        DHCP-Transaction-Id = 42
        DHCP-Number-of-Seconds = 0
        DHCP-Flags = 0
        DHCP-Client-IP-Address = 0.0.0.0
        DHCP-Your-IP-Address = 0.0.0.0
        DHCP-Server-IP-Address = 0.0.0.0
        DHCP-Gateway-IP-Address = 3.19.11.10
        DHCP-Server-Host-Name = "\001\006DHBf"
        DHCP-Network-Subnet = 3.19.11.10/32



Regards,
Nicolas.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



More information about the Freeradius-Devel mailing list