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
Unknown Object (File)
Sep 26 2024, 9:52 PM
Unknown Object (File)
Sep 24 2024, 4:20 AM
Unknown Object (File)
Sep 23 2024, 3:43 PM
Unknown Object (File)
Sep 18 2024, 9:09 AM
Unknown Object (File)
Sep 4 2024, 5:48 AM
Unknown Object (File)
Aug 30 2024, 3:14 AM
Unknown Object (File)
Aug 30 2024, 2:02 AM
Unknown Object (File)
Aug 23 2024, 2:37 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 Not Applicable
Unit
Tests Not Applicable

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.