Page MenuHomeFreeBSD

dhclient: do not add 0.0.0.0 interface alias.
ClosedPublic

Authored by melifaro on Mar 4 2023, 3:18 PM.
Tags
None
Referenced Files
F108749215: D38908.diff
Mon, Jan 27, 5:05 PM
Unknown Object (File)
Sun, Jan 19, 4:07 AM
Unknown Object (File)
Sat, Jan 4, 11:42 AM
Unknown Object (File)
Dec 5 2024, 10:52 PM
Unknown Object (File)
Dec 5 2024, 10:52 PM
Unknown Object (File)
Dec 5 2024, 10:52 PM
Unknown Object (File)
Dec 5 2024, 10:52 PM
Unknown Object (File)
Dec 1 2024, 5:07 PM

Details

Summary

Initially dhclient used raw IP sockets to send the DHCP/BOOTP messages.
As there was no API to set the source IP to 0.0.0.0 for the raw sockets, dhcp client assigned 0.0.0.0 ip to the interface needed to setup.
Later, around 1998, BPF support appeared, removing the need to use the 0.0.0.0 hack on the systems with BPF.
As the 0.0.0.0 assignment was done in the dhclient-script "OS-agnostic" shell hook, it took a while to remove it.
OpenBSD switched to BPF-by-default in Feb 2004.
FreeBSD merged dhclient from the OpenBSD 3.7 (May 2005). After the 3.7 release, OpenBSD dropped this 0.0.0.0 hack.
FreeBSD never did that.

This change removes the initial 0.0.0.0 IPv4 address assignment from the dhclient scripts, as it serves no purpose.
It is effectively the copy of the OpenBSD change.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 50148
Build 47040: arc lint + arc unit

Event Timeline

melifaro added a reviewer: network.

I've tested the change several times including boot-time test and it just works for me using vtnet0.

This revision is now accepted and ready to land.Mar 5 2023, 12:15 PM

I will commit it on Tuesday, Mar 7, unless I get any objections.