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)
Mar 12 2024, 8:57 PM
Unknown Object (File)
Mar 12 2024, 8:57 PM
Unknown Object (File)
Mar 8 2024, 11:32 PM
Unknown Object (File)
Mar 8 2024, 7:51 PM
Unknown Object (File)
Mar 8 2024, 6:20 PM
Unknown Object (File)
Jan 30 2024, 3:11 PM
Unknown Object (File)
Dec 23 2023, 12:50 AM
Unknown Object (File)
Dec 12 2023, 1:58 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.