allow ipv4 routes without gateway in configuration
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 22 Dec 2008 02:21:25 +0000 (02:21 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 22 Dec 2008 02:21:25 +0000 (02:21 +0000)
SVN-Revision: 13714

package/base-files/files/etc/hotplug.d/iface/10-routes

index dd6ae508879f3a1de267a208ace51d59a326fdd1..0eb92870fc9f021af634dbece531386fec6b1550 100644 (file)
@@ -27,7 +27,8 @@ add_route() {
        dest="${netmask:+-net "$target" netmask "$netmask"}"
        dest="${dest:--host "$target"}"
        
-       /sbin/route add $dest gw "$gateway" ${dev:+dev "$dev"} ${metric:+ metric "$metric"}
+       /sbin/route add $dest ${gateway:+gw "$gateway"} \
+               ${dev:+dev "$dev"} ${metric:+ metric "$metric"}
 }
 
 add_route6() {
@@ -54,7 +55,8 @@ add_route6() {
                config_get gateway "$interface" gateway
        }
 
-       /sbin/route -A inet6 add $target ${gateway:+gw "$gateway"} ${dev:+dev "$dev"} ${metric:+ metric "$metric"}
+       /sbin/route -A inet6 add $target ${gateway:+gw "$gateway"} \
+               ${dev:+dev "$dev"} ${metric:+ metric "$metric"}
 }
 
 case "$ACTION" in