[master] function fr_dhcpv4_encode is badly broken

Alan DeKok aland at deployingradius.com
Fri Nov 6 18:17:10 CET 2020


On Nov 6, 2020, at 10:23 AM, Chaigneau, Nicolas via Freeradius-Devel <freeradius-devel at lists.freeradius.org> wrote:
> 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...):

  It used to print the header field names and values, and then *also* any attributes in the packet.  If the packet included attributes for the header, those attributes would be printed twice.

> Some fields are wrong, for example: the first "DHCP-Gateway-IP-Address" is the value provided, but the second is reversed.

  OK, the first time it prints it out normally, the second time it perhaps has an incorrect htonl()?

> There is a "DHCP-Server-Host-Name", "DHCP-Message-Type" is missing, etc.

  DHCP-Server-host-Name is there, but it's garbage.

  What does the actual packet look like?

  i.e. is this just a *debug output* issue, or is the packet wrong?

  Alan DeKok.




More information about the Freeradius-Devel mailing list