From e484808b3fc0490a6cd977f83a32926e1004ee74 Mon Sep 17 00:00:00 2001 From: bol-van Date: Fri, 4 Mar 2022 19:06:26 +0300 Subject: [PATCH] move local var definitions --- common/ipt.sh | 8 ++++---- common/nft.sh | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/ipt.sh b/common/ipt.sh index 0e1e822..5ca11ed 100644 --- a/common/ipt.sh +++ b/common/ipt.sh @@ -248,6 +248,10 @@ zapret_do_firewall_rules_ipt() { local mode="${MODE_OVERRIDE:-$MODE}" + local first_packet_only="-m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:4" + local desync="-m mark ! --mark $DESYNC_MARK/$DESYNC_MARK" + local f4 f6 qn qns qn6 qns6 + case "$mode" in tpws) if [ ! "$MODE_HTTP" = "1" ] && [ ! "$MODE_HTTPS" = "1" ]; then @@ -320,10 +324,6 @@ zapret_do_firewall_ipt() [ "$mode" = "tpws-socks" ] && return 0 - local first_packet_only="-m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:4" - local desync="-m mark ! --mark $DESYNC_MARK/$DESYNC_MARK" - local f4 f6 qn qns qn6 qns6 - # always create ipsets. ip_exclude ipset is required [ "$1" = 1 ] && create_ipset no-update diff --git a/common/nft.sh b/common/nft.sh index 81b14c8..ac5c137 100644 --- a/common/nft.sh +++ b/common/nft.sh @@ -441,6 +441,10 @@ zapret_apply_firewall_rules_nft() { local mode="${MODE_OVERRIDE:-$MODE}" + local first_packet_only="ct original packets 1-4" + local desync="mark and $DESYNC_MARK == 0" + local f4 f6 qn qns qn6 qns6 + case "$mode" in tpws) if [ ! "$MODE_HTTP" = "1" ] && [ ! "$MODE_HTTPS" = "1" ]; then @@ -506,10 +510,6 @@ zapret_apply_firewall_nft() [ "$mode" = "tpws-socks" ] && return 0 - local first_packet_only="ct original packets 1-4" - local desync="mark and $DESYNC_MARK == 0" - local f4 f6 qn qns qn6 qns6 - create_ipset no-update nft_create_firewall nft_fill_ifsets_overload @@ -537,6 +537,6 @@ zapret_do_firewall_nft() else zapret_apply_firewall_nft fi - + return 0 }