Skip to content

Commit

Permalink
dhclient: rc.conf option to disable ARP resolution
Browse files Browse the repository at this point in the history
Introduce a new rc.conf option to not wait for ARP resolution within
dhclient. This is plausible on many modern networks where it is possible
to trust the DHCP server to know whether an IP address is available.

Sponsored by: Google LLC (GSoC 2024)
  • Loading branch information
ica574 committed Aug 6, 2024
1 parent 4e421d0 commit 32fd883
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions libexec/rc/rc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ dhclient_flags="" # Extra flags to pass to dhcp client.
#dhclient_flags_em0="" # Extra dhclient flags for em0 only
background_dhclient="NO" # Start dhcp client in the background.
#background_dhclient_em0="YES" # Start dhcp client on em0 in the background.
dhclient_noarpwait="NO" # Trust IP address from DHCP and don't ARP
synchronous_dhclient="NO" # Start dhclient directly on configured
# interfaces during startup.
defaultroute_delay="30" # Time to wait for a default route on a DHCP interface.
Expand Down
4 changes: 4 additions & 0 deletions libexec/rc/rc.d/dhclient
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ dhclient_prestart()
rc_flags="${rc_flags} -b"
fi

dhclient_noarpwait=$(get_if_var $ifn dhclient_noarpwait_IF $dhclient_noarpwait)
if checkyesno dhclient_noarpwait; then
rc_flags="${rc_flags} -n"
fi

# /var/run/dhclient is not guaranteed to exist,
# e.g. if /var/run is a tmpfs

Check warning on line 57 in libexec/rc/rc.d/dhclient

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
Expand Down

0 comments on commit 32fd883

Please sign in to comment.