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)
Thu, Oct 2, 2:40 AM
Unknown Object (File)
Thu, Oct 2, 1:40 AM
Unknown Object (File)
Wed, Oct 1, 3:58 PM
Unknown Object (File)
Wed, Oct 1, 11:20 AM
Unknown Object (File)
Tue, Sep 30, 8:09 AM
Unknown Object (File)
Tue, Sep 30, 2:05 AM
Unknown Object (File)
Aug 25 2025, 12:27 AM
Unknown Object (File)
Jul 11 2025, 3:02 PM

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