kernel: disable accept_ra by default
[openwrt/staging/mans0n.git] / package / base-files / files / etc / init.d / sysctl
index 8722126a6612d67a3f615166a7fbec146207e97f..a236a0194b665ff56c8330930bfd44709d1b0d3d 100755 (executable)
@@ -26,6 +26,14 @@ apply_defaults() {
                net.ipv6.ip6frag_high_thresh="$frag_high_thresh" \
                net.netfilter.nf_conntrack_frag6_low_thresh="$frag_low_thresh" \
                net.netfilter.nf_conntrack_frag6_high_thresh="$frag_high_thresh"
+
+       # first set default, then all interfaces to avoid races with appearing interfaces
+       if [ -d /proc/sys/net/ipv6/conf ]; then
+               echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra
+               for iface in /proc/sys/net/ipv6/conf/*/accept_ra; do
+                       echo 0 > "$iface"
+               done
+       fi
 }
 
 start() {