Browse Source

shadowsocks-libev: ss-rules: tweak for readability

- quash errors on detection of ipv6 nat
 - remove unnecessary rule args "--comment ..." and "-p ..."

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
lilik-openwrt-22.03
Yousong Zhou 6 years ago
parent
commit
8cba4a7f8b
2 changed files with 7 additions and 7 deletions
  1. +1
    -1
      net/shadowsocks-libev/Makefile
  2. +6
    -6
      net/shadowsocks-libev/files/ss-rules

+ 1
- 1
net/shadowsocks-libev/Makefile View File

@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
# #
PKG_NAME:=shadowsocks-libev PKG_NAME:=shadowsocks-libev
PKG_VERSION:=3.2.3 PKG_VERSION:=3.2.3
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)


+ 6
- 6
net/shadowsocks-libev/files/ss-rules View File

@ -13,8 +13,8 @@ __errmsg() {
} }
if [ "$1" = "-6" ]; then if [ "$1" = "-6" ]; then
if ! ip6tables -t nat -L -n >/dev/null; then
__errmsg "Skipping ipv6. Please install ip6tables-mod-nat"
if ! ip6tables -t nat -L -n &>/dev/null; then
__errmsg "Skipping ipv6. Requires ip6tables-mod-nat"
exit 1 exit 1
fi fi
o_use_ipv6=1; shift o_use_ipv6=1; shift
@ -210,7 +210,7 @@ ss_rules_iptchains_init_tcp() {
:ss_rules_local_out - :ss_rules_local_out -
-I OUTPUT 1 -p tcp -j ss_rules_local_out -I OUTPUT 1 -p tcp -j ss_rules_local_out
-A ss_rules_local_out -m set --match-set ss_rules${o_af}_dst_bypass_ dst -j RETURN -A ss_rules_local_out -m set --match-set ss_rules${o_af}_dst_bypass_ dst -j RETURN
-A ss_rules_local_out -p tcp $o_ipt_extra -j $local_target -m comment --comment "local_default: $o_local_default"
-A ss_rules_local_out $o_ipt_extra -j $local_target
COMMIT COMMIT
EOF EOF
} }
@ -265,15 +265,15 @@ ss_rules_iptchains_init_() {
:ss_rules_forward - :ss_rules_forward -
$(ss_rules_iptchains_mkprerules "$proto") $(ss_rules_iptchains_mkprerules "$proto")
-A ss_rules_pre_src -m set --match-set ss_rules${o_af}_dst_bypass_ dst -j RETURN -A ss_rules_pre_src -m set --match-set ss_rules${o_af}_dst_bypass_ dst -j RETURN
-A ss_rules_pre_src -p $proto $o_ipt_extra -j ss_rules_src
-A ss_rules_pre_src $o_ipt_extra -j ss_rules_src
-A ss_rules_src -m set --match-set ss_rules${o_af}_src_bypass src -j RETURN -A ss_rules_src -m set --match-set ss_rules${o_af}_src_bypass src -j RETURN
-A ss_rules_src -m set --match-set ss_rules${o_af}_src_forward src -j ss_rules_forward -A ss_rules_src -m set --match-set ss_rules${o_af}_src_forward src -j ss_rules_forward
-A ss_rules_src -m set --match-set ss_rules${o_af}_src_checkdst src -j ss_rules_dst -A ss_rules_src -m set --match-set ss_rules${o_af}_src_checkdst src -j ss_rules_dst
-A ss_rules_src -j $src_default_target -m comment --comment "src_default: $o_src_default"
-A ss_rules_src -j $src_default_target
-A ss_rules_dst -m set --match-set ss_rules${o_af}_dst_bypass dst -j RETURN -A ss_rules_dst -m set --match-set ss_rules${o_af}_dst_bypass dst -j RETURN
-A ss_rules_dst -m set --match-set ss_rules${o_af}_dst_forward dst -j ss_rules_forward -A ss_rules_dst -m set --match-set ss_rules${o_af}_dst_forward dst -j ss_rules_forward
$recentrst_addset_rules $recentrst_addset_rules
-A ss_rules_dst -j $dst_default_target -m comment --comment "dst_default: $o_dst_default"
-A ss_rules_dst -j $dst_default_target
$forward_rules $forward_rules
COMMIT COMMIT
$recentrst_mangle_rules $recentrst_mangle_rules


Loading…
Cancel
Save