networking: Allow changing DHCP Option Rapid Commit

This option needs to be configurable since some (braindead) ISPs have
started running broken DHCP servers to be bug-compatible with cheap
broken plastic routers.

By default we keep this option enabled, but it can now be turned off
whenever needed.

Suggested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Michael Tremer
2024-10-16 10:47:17 +00:00
committed by Arne Fitzenreiter
parent 7350feee58
commit c6282b001b
3 changed files with 50 additions and 15 deletions

View File

@@ -171,9 +171,20 @@ case "${1}" in
# To determine this we check if a wpa_supplicant is running.
pid="$(pidof wpa_supplicant)"
DHCPCD_ARGS=()
# Enable Rapid Commit (enabled by default)
case "${RED_DHCP_RAPID_COMMIT}" in
""|yes|true|on)
DHCPCD_ARGS+=( "--option" "rapid_commit" )
;;
esac
echo dhcpcd_start "${DEVICE}" "${DHCPCD_ARGS[@]}"
if [ -z "${pid}" ]; then
# No wpa_supplicant is running. So it's save to start dhcpcd.
dhcpcd_start "${DEVICE}"
dhcpcd_start "${DEVICE}" "${DHCPCD_ARGS[@]}"
fi
elif [ "$TYPE" == "PPPOE" ]; then