odhcp6c : Silence mtu write error warnings
authorJohn Crispin <john@openwrt.org>
Sun, 20 Mar 2016 18:48:59 +0000 (18:48 +0000)
committerJohn Crispin <john@openwrt.org>
Sun, 20 Mar 2016 18:48:59 +0000 (18:48 +0000)
Silence warning "daemon.notice netifd: wan6 (1139): sh: write error: Invalid argument"
when an invalid MTU is received via RA as kernel refuses to accept IPv6 mtu values
which are smaller than 1280 and bigger than the device mtu.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
SVN-Revision: 49054

package/network/ipv6/odhcp6c/files/dhcpv6.script

index c307d095804a94e1486451f7c2433c17e6939eb6..46980cb57dfec46f2d0babe14f7a6aab89fea0c6 100755 (executable)
@@ -185,7 +185,7 @@ setup_interface () {
        # Apply IPv6 / ND configuration
        HOPLIMIT=$(cat /proc/sys/net/ipv6/conf/$device/hop_limit)
        [ -n "$RA_HOPLIMIT" -a -n "$HOPLIMIT" ] && [ "$RA_HOPLIMIT" -gt "$HOPLIMIT" ] && echo "$RA_HOPLIMIT" > /proc/sys/net/ipv6/conf/$device/hop_limit
-       [ -n "$RA_MTU" ] && [ "$RA_MTU" -gt 0 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu
+       [ -n "$RA_MTU" ] && [ "$RA_MTU" -ge 1280 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu 2>/dev/null
        [ -n "$RA_REACHABLE" ] && [ "$RA_REACHABLE" -gt 0 ] && echo "$RA_REACHABLE" > /proc/sys/net/ipv6/neigh/$device/base_reachable_time_ms
        [ -n "$RA_RETRANSMIT" ] && [ "$RA_RETRANSMIT" -gt 0 ] && echo "$RA_RETRANSMIT" > /proc/sys/net/ipv6/neigh/$device/retrans_time_ms