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
F137644339: D14527.diff
Mon, Nov 24, 6:29 PM
F137537599: D14527.id39813.diff
Mon, Nov 24, 5:32 AM
Unknown Object (File)
Sun, Nov 23, 2:21 AM
Unknown Object (File)
Sat, Nov 22, 6:36 AM
Unknown Object (File)
Tue, Nov 18, 5:07 AM
Unknown Object (File)
Sun, Oct 26, 4:21 PM
Unknown Object (File)
Sun, Oct 26, 7:34 AM
Unknown Object (File)
Oct 22 2025, 9:46 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