add static route fix from #1384
[openwrt/svn-archive/openwrt.git] / openwrt / package / base-files / default / etc / functions.sh
index 70b30868491645fb362c3215f5eca34980db485a..57f2734c1c4c047312e7383b2a6e534840d91591 100755 (executable)
@@ -56,10 +56,11 @@ do_ifup() {
                [ -n "$static_route" ] && {
                        for route in $static_route; do {
                        eval "set $(echo $route | sed 's/:/ /g')"
-                               if [ "$2" = "255.255.255.255" ]; then
+                               if [ "$2" = "0.0.0.0" ]; then
                                        opt="-host"
                                fi
                                $DEBUG route add ${opt:-"-net"} $1 netmask $2 gw $3 metric $4 
+                               unset opt
                        } done
                }