IPv6 SmartGW doesn't require IPv6 NAT support
[feed/routing.git] / olsrd / files / olsrd.init
index 7ffe33c12a476cc06e461b6a385ced7eaeb88a7c..c8f1df566c1b1b975fbf717d3d6f615c3444709b 100644 (file)
@@ -13,7 +13,7 @@ PID6=/var/run/olsrd.ipv6.pid
 OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes'
 OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2'
 OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2'
-OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool'
+OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool LinkQualityMult:list2'
 OLSRD_INTERFACE_DEFAULTS_SCHEMA='AutoDetectChanges:bool'
 
 T='    '
@@ -153,8 +153,11 @@ olsrd_write_plparam() {
                return 1
        fi
 
-       oldIFS="$IFS"; IFS='-_'; set -- $option; IFS="$oldIFS"
+       oldIFS="$IFS"
+       IFS='-_'
+       set -- $option
        option="$*"
+       IFS="$oldIFS"
        _option="$option"
 
        if [ "$option" = 'hosts' ]; then
@@ -561,6 +564,12 @@ olsrd_write_interface() {
                        if network_get_device IFNAME "$interface"; then
                                ifnames="$ifnames \"$IFNAME\""
                                ifsglobal="$ifsglobal $IFNAME"
+                       elif network_get_physdev IFNAME "$interface"; then
+                               local proto="$(uci -q get network.${interface}.proto)"
+                               if [ "$proto" = "static" -o "$proto" = "none" ]; then
+                                       ifnames="$ifnames \"$IFNAME\""
+                                       ifsglobal="$ifsglobal $IFNAME"
+                               fi
                        else
                                log "$funcname() Warning: Interface '$interface' not found, skipped"
                        fi
@@ -723,9 +732,9 @@ olsrd_setup_smartgw_rules() {
                                        $IP6T -I input_rule -i $IFACE -p 4 -j ACCEPT
                                done
                        else
+                               $IP4T -t nat -I postrouting_rule -o tnl_+ -j MASQUERADE
                                for IPT in $IP4T $IP6T; do
                                        $IPT -I forwarding_rule -o tnl_+ -j ACCEPT
-                                       $IPT -t nat -I postrouting_rule -o tnl_+ -j MASQUERADE
                                        if [ "$nowan"="0" ]; then
                                                for IFACE in $wanifnames; do
                                                        $IPT -A forwarding_rule -i tunl0 -o $IFACE -j ACCEPT