From: Frank Deng Date: Sat, 15 Jun 2019 20:35:42 +0000 (-0700) Subject: 35network-legacy: fix classless static route parsing X-Git-Tag: 050~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11e1f680656177cfbba4e06f08b6707f4a812bc0;p=thirdparty%2Fdracut.git 35network-legacy: fix classless static route parsing --- diff --git a/modules.d/35network-legacy/dhclient-script.sh b/modules.d/35network-legacy/dhclient-script.sh index fc6ed0a36..66cfe34bf 100755 --- a/modules.d/35network-legacy/dhclient-script.sh +++ b/modules.d/35network-legacy/dhclient-script.sh @@ -126,9 +126,11 @@ parse_option_121() { elif [ $mask -gt 8 ]; then destination="$1.$2.0.0/$mask" shift; shift - else + elif [ $mask -gt 0 ]; then destination="$1.0.0.0/$mask" shift + else + destination="0.0.0.0/$mask" fi # Read the gateway @@ -138,7 +140,7 @@ parse_option_121() { # Multicast routing on Linux # - If you set a next-hop address for a multicast group, this breaks with Cisco switches # - If you simply leave it link-local and attach it to an interface, it works fine. - if [ $multicast -eq 1 ]; then + if [ $multicast -eq 1 -o "$gateway" = "0.0.0.0" ]; then temp_result="$destination dev $interface" else temp_result="$destination via $gateway dev $interface"