35network-legacy: fix classless static route parsing

master
Frank Deng 2019-06-15 13:35:42 -07:00 committed by Harald Hoyer
parent c21c1d459e
commit 11e1f68065
1 changed files with 4 additions and 2 deletions

View File

@ -126,9 +126,11 @@ parse_option_121() {
elif [ $mask -gt 8 ]; then elif [ $mask -gt 8 ]; then
destination="$1.$2.0.0/$mask" destination="$1.$2.0.0/$mask"
shift; shift shift; shift
else elif [ $mask -gt 0 ]; then
destination="$1.0.0.0/$mask" destination="$1.0.0.0/$mask"
shift shift
else
destination="0.0.0.0/$mask"
fi fi


# Read the gateway # Read the gateway
@ -138,7 +140,7 @@ parse_option_121() {
# Multicast routing on Linux # Multicast routing on Linux
# - If you set a next-hop address for a multicast group, this breaks with Cisco switches # - 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 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" temp_result="$destination dev $interface"
else else
temp_result="$destination via $gateway dev $interface" temp_result="$destination via $gateway dev $interface"