]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
35network-legacy: using 'replace' instead of 'add' to add route
authorJacob Wen <jian.w.wen@oracle.com>
Tue, 26 Nov 2019 07:50:36 +0000 (15:50 +0800)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 14 Jan 2020 08:26:12 +0000 (09:26 +0100)
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 <jian.w.wen@oracle.com>
modules.d/35network-legacy/dhclient-script.sh

index 66cfe34bffdde2ef41e93c90572b6825931482a0..04cabb3c048f532842d5ed74a5846f00369ec2c9 100755 (executable)
@@ -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
 }