Page MenuHomeFreeBSD

dhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP
ClosedPublic

Authored by dab on Feb 26 2018, 8:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 13 2024, 2:20 AM
Unknown Object (File)
Nov 11 2023, 10:40 AM
Unknown Object (File)
Nov 9 2023, 10:40 AM
Unknown Object (File)
Nov 4 2023, 5:31 AM
Unknown Object (File)
Oct 8 2023, 9:37 AM
Unknown Object (File)
Oct 3 2023, 5:31 AM
Unknown Object (File)
Sep 19 2023, 10:28 AM
Unknown Object (File)
Jun 30 2023, 11:39 AM

Details

Summary

When dhclient first starts, if an old IP address exists in the dhclient.leases file, dhclient(8) sends early DHCPREQUEST message(s) in an attempt to re-obtain the old IP address again. These messages contain the old IP as a requested-IP-address option in the message body (correct) but the message also uses the old IP address as the packet's source IP (incorrect).

RFC2131 sec 4.1 states:

DHCP messages broadcast by a client prior to that client obtaining
its IP address must have the source address field in the IP header
set to 0.

The use of the old IP as the packet's source address is incorrect if (a) the computer is now on a different network or (b) it is on the same network, but the old IP has been reallocated to another host.

The attached patch fixes things to use 0.0.0.0 as the source IP without removing any existing functionality. Any previously-used old IP is still requested in the body of an early DHCPREQUEST message.

PR: 199378
Reported by: J.R. Oldroyd <fbsd@opal.com>
Submitted by: J.R. Oldroyd <fbsd@opal.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable