From: Jacob Wen Date: Tue, 26 Nov 2019 07:50:36 +0000 (+0800) Subject: 35network-legacy: using 'replace' instead of 'add' to add route X-Git-Tag: 050~72 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fdracut.git;a=commitdiff_plain;h=d5e818f3490e8840f56de03ba92297f44e507be2 35network-legacy: using 'replace' instead of 'add' to add route This is a simple trick to honor RFC 3442: If the DHCP server returns both a Classless Static Routes option and a Router option, the DHCP client MUST ignore the Router option. Signed-off-by: Jacob Wen --- diff --git a/modules.d/35network-legacy/dhclient-script.sh b/modules.d/35network-legacy/dhclient-script.sh index 66cfe34bf..04cabb3c0 100755 --- a/modules.d/35network-legacy/dhclient-script.sh +++ b/modules.d/35network-legacy/dhclient-script.sh @@ -146,7 +146,7 @@ parse_option_121() { temp_result="$destination via $gateway dev $interface" fi - echo "/sbin/ip route add $temp_result" + echo "/sbin/ip route replace $temp_result" done }