From c5c55e5419f7e6c67646cf9449146e9a94be350c Mon Sep 17 00:00:00 2001 From: bolvan Date: Wed, 15 May 2019 17:25:44 +0300 Subject: [PATCH] init : do not query for dnat6_target more than once --- init.d/openwrt/functions | 2 +- init.d/sysv/functions | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/init.d/openwrt/functions b/init.d/openwrt/functions index e3e5df8..09b7072 100644 --- a/init.d/openwrt/functions +++ b/init.d/openwrt/functions @@ -80,7 +80,7 @@ dnat6_target() # link local address can appear not immediately after ifup # DNAT6_TARGET=- means attempt was made but address was not found (to avoid multiple re-attempts) - [ "$DNAT6_TARGET" = '-' ] || { + [ -n "$DNAT6_TARGET" ] || { # no reason to query if its down network_is_up lan || return diff --git a/init.d/sysv/functions b/init.d/sysv/functions index 280cb4f..6052cf8 100644 --- a/init.d/sysv/functions +++ b/init.d/sysv/functions @@ -105,7 +105,7 @@ dnat6_target() # link local address can appear not immediately after ifup # DNAT6_TARGET=- means attempt was made but address was not found (to avoid multiple re-attempts) - [ "$DNAT6_TARGET" = '-' ] || { + [ -n "$DNAT6_TARGET" ] || { local ct=0 while DNAT6_TARGET=$(get_ipv6_linklocal $IFACE_LAN)