diff --git a/init.d/macos/functions b/init.d/macos/functions index 0734f8e..fbba7c6 100644 --- a/init.d/macos/functions +++ b/init.d/macos/functions @@ -10,7 +10,8 @@ HOSTLIST="$ZHOSTLIST.gz" PIDDIR=/var/run [ -n "$TPPORT" ] || TPPORT=988 TPWS_USER=daemon -TPWS_WAIT="--bind-wait-ip=60" +TPWS_WAIT="--bind-wait-ifup=30 --bind-wait-ip=30" +TPWS_WAIT_SOCKS6="$TPWS_WAIT --bind-wait-ip-linklocal=30" TPWS="$ZAPRET_BASE/tpws/tpws" PF_MAIN="/etc/pf.conf" @@ -108,7 +109,7 @@ tpws_apply_socks_binds() } [ "$DISABLE_IPV6" = "1" ] || { o="$o --bind-addr=::1" - [ -n "$IFACE_LAN" ] && o="$o --bind-iface6=$IFACE_LAN $TPWS_WAIT" + [ -n "$IFACE_LAN" ] && o="$o --bind-iface6=$IFACE_LAN --bind-linklocal=unwanted $TPWS_WAIT_SOCKS6" } eval $1="\"\$$1 $o\"" } diff --git a/init.d/openwrt/zapret b/init.d/openwrt/zapret index d1f075b..31019f8 100755 --- a/init.d/openwrt/zapret +++ b/init.d/openwrt/zapret @@ -31,7 +31,8 @@ HOSTLIST="$ZAPRET_BASE/ipset/zapret-hosts.txt.gz" TPWS_OPT_BASE="--user=$TPWS_USER --port=$TPPORT" TPWS_OPT_BASE4="--bind-addr=$TPWS_LOCALHOST4" TPWS_OPT_BASE6="--bind-addr=::1" -TPWS_WAIT="--bind-wait-ip=60" +TPWS_WAIT="--bind-wait-ifup=30 --bind-wait-ip=30" +TPWS_WAIT_SOCKS6="$TPWS_WAIT --bind-wait-ip-linklocal=30" TPWS_OPT_BASE6_PRE="--bind-linklocal=prefer $TPWS_WAIT --bind-wait-ip-linklocal=3" run_daemon() @@ -87,7 +88,7 @@ tpws_apply_socks_binds() } [ "$DISABLE_IPV6" = "1" ] || { o="$o --bind-addr=::1" - [ -n "$DEVICE" ] && o="$o --bind-iface6=$DEVICE $TPWS_WAIT" + [ -n "$DEVICE" ] && o="$o --bind-iface6=$DEVICE --bind-linklocal=unwanted $TPWS_WAIT_SOCKS6" } eval $1="\"\$$1 $o\"" } diff --git a/init.d/sysv/functions b/init.d/sysv/functions index 5e88b8c..ac63f92 100644 --- a/init.d/sysv/functions +++ b/init.d/sysv/functions @@ -24,7 +24,8 @@ HOSTLIST="$ZAPRET_BASE/ipset/zapret-hosts.txt.gz" TPWS_OPT_BASE="--user=$WS_USER --port=$TPPORT" TPWS_OPT_BASE4="--bind-addr=$TPWS_LOCALHOST4" TPWS_OPT_BASE6="--bind-addr=::1" -TPWS_WAIT="--bind-wait-ip=60" +TPWS_WAIT="--bind-wait-ifup=30 --bind-wait-ip=30" +TPWS_WAIT_SOCKS6="$TPWS_WAIT --bind-wait-ip-linklocal=30" # first wait for lan to ifup, then wait for bind-wait-ip-linklocal seconds for link local address and bind-wait-ip for any ipv6 as the worst case TPWS_OPT_BASE6_PRE="--bind-linklocal=prefer $TPWS_WAIT --bind-wait-ip-linklocal=3" @@ -436,7 +437,7 @@ tpws_apply_socks_binds() } [ "$DISABLE_IPV6" = "1" ] || { o="$o --bind-addr=::1" - [ -n "$IFACE_LAN" ] && o="$o --bind-iface6=$IFACE_LAN $TPWS_WAIT" + [ -n "$IFACE_LAN" ] && o="$o --bind-iface6=$IFACE_LAN --bind-linklocal=unwanted $TPWS_WAIT_SOCKS6" } eval $1="\"\$$1 $o\"" }