odhcp6c: silence "bad number" warnings
authorSteven Barth <cyrus@openwrt.org>
Wed, 15 Apr 2015 14:04:17 +0000 (14:04 +0000)
committerSteven Barth <cyrus@openwrt.org>
Wed, 15 Apr 2015 14:04:17 +0000 (14:04 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 45449

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

index be74b01e4eb040e3756b4d0734e82ff5006f8a31..515bee32b4c79896fc5834db821730c80ad5f25f 100755 (executable)
@@ -164,10 +164,10 @@ setup_interface () {
 
        # Apply IPv6 / ND configuration
        HOPLIMIT=$(cat /proc/sys/net/ipv6/conf/$device/hop_limit)
-       [ "$RA_HOPLIMIT" -gt "$HOPLIMIT" ] && echo "$RA_HOPLIMIT" > /proc/sys/net/ipv6/conf/$device/hop_limit
-       [ "$RA_MTU" -gt 0 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu
-       [ "$RA_REACHABLE" -gt 0 ] && echo "$RA_REACHABLE" > /proc/sys/net/ipv6/neigh/$device/base_reachable_time_ms
-       [ "$RA_RETRANSMIT" -gt 0 ] && echo "$RA_RETRANSMIT" > /proc/sys/net/ipv6/neigh/$device/retrans_time_ms
+       [ -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_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
 
        # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
 }