shadowsocks-libev: ss-rules: setup policy rules for udp/ip6
authorYousong Zhou <yszhou4tech@gmail.com>
Wed, 10 Aug 2022 11:04:41 +0000 (19:04 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Thu, 11 Aug 2022 01:54:18 +0000 (09:54 +0800)
Supersedes: https://github.com/openwrt/packages/pull/18852
Fixes: https://github.com/openwrt/packages/issues/18850
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
net/shadowsocks-libev/Makefile
net/shadowsocks-libev/files/ss-rules/chain.uc

index 7ef1706d3d167f359ca3b26f0d1a67d0afd0641c..4fa49a956de22368e86e883826429a2421acc16c 100644 (file)
@@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
 #
 PKG_NAME:=shadowsocks-libev
 PKG_VERSION:=3.3.5
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
index a378e770e6796c8527749a44b74a3590ff1d44d8..3047f16632eca97ff64a540b36ea70d612991000 100644 (file)
@@ -52,10 +52,14 @@ if (proto == "tcp") {
        redir_port = o_redir_udp_port;
        if (system("
                set -o errexit
-               while ip rule del fwmark 1 lookup 100 2>/dev/null; do true; done
-                     ip rule add fwmark 1 lookup 100
-               ip route flush table 100 2>/dev/null || true
-               ip route add local default dev lo table 100
+               iprr() {
+                       while ip $1 rule del fwmark 1 lookup 100 2>/dev/null; do true; done
+                             ip $1 rule add fwmark 1 lookup 100
+                       ip $1 route flush table 100 2>/dev/null || true
+                       ip $1 route add local default dev lo table 100
+               }
+               iprr -4
+               iprr -6
        ") != 0) {
                return ;
        }