OSDN Git Service

v2raya: backport fixes for tproxy
authorTianling Shen <cnsztl@immortalwrt.org>
Wed, 22 Feb 2023 06:43:56 +0000 (14:43 +0800)
committerTianling Shen <cnsztl@immortalwrt.org>
Wed, 22 Feb 2023 06:43:56 +0000 (14:43 +0800)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
v2raya/Makefile
v2raya/patches/019-fix-tproxy-cannot-work-on-openwrt-ifname-is-br-lan.patch [new file with mode: 0644]
v2raya2/001-fix-tproxy-cannot-work-on-openwrt-ifname-is-br-lan.patch [new file with mode: 0644]
v2raya2/Makefile

index b36a0b0..a6c5e67 100644 (file)
@@ -1,12 +1,12 @@
 # SPDX-License-Identifier: GPL-3.0-only
 #
-# Copyright (C) 2021 ImmortalWrt.org
+# Copyright (C) 2021-2023 ImmortalWrt.org
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=v2rayA
 PKG_VERSION:=1.5.9.1698.1
-PKG_RELEASE:=$(AUTORELEASE)
+PKG_RELEASE:=7
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)?
diff --git a/v2raya/patches/019-fix-tproxy-cannot-work-on-openwrt-ifname-is-br-lan.patch b/v2raya/patches/019-fix-tproxy-cannot-work-on-openwrt-ifname-is-br-lan.patch
new file mode 100644 (file)
index 0000000..d60074b
--- /dev/null
@@ -0,0 +1,36 @@
+From 8325b18738061f16eeeef13a2cbe39f9f5cfec91 Mon Sep 17 00:00:00 2001
+From: mzz2017 <2017@duck.com>
+Date: Sat, 11 Feb 2023 22:54:40 +0800
+Subject: [PATCH] fix: tproxy cannot work on openwrt (ifname is br-lan)
+
+---
+ service/core/iptables/tproxy.go | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/core/iptables/tproxy.go
++++ b/core/iptables/tproxy.go
+@@ -16,7 +16,7 @@ var Tproxy tproxy
+ func (t *tproxy) AddIPWhitelist(cidr string) {
+       // avoid duplication
+       t.RemoveIPWhitelist(cidr)
+-      pos := 8
++      pos := 7
+       if configure.GetSettingNotNil().AntiPollution != configure.AntipollutionClosed {
+               pos += 3
+       }
+@@ -65,7 +65,6 @@ iptables -w 2 -t mangle -A TP_PRE -p udp
+ iptables -w 2 -t mangle -A TP_RULE -j CONNMARK --restore-mark
+ iptables -w 2 -t mangle -A TP_RULE -m mark --mark 0x40/0xc0 -j RETURN
+-iptables -w 2 -t mangle -A TP_RULE -i br-+ -j RETURN
+ iptables -w 2 -t mangle -A TP_RULE -i docker+ -j RETURN
+ iptables -w 2 -t mangle -A TP_RULE -i veth+ -j RETURN
+ iptables -w 2 -t mangle -A TP_RULE -i ppp+ -j RETURN
+@@ -126,7 +125,6 @@ ip6tables -w 2 -t mangle -A TP_PRE -p ud
+ ip6tables -w 2 -t mangle -A TP_RULE -j CONNMARK --restore-mark
+ ip6tables -w 2 -t mangle -A TP_RULE -m mark --mark 0x40/0xc0 -j RETURN
+-ip6tables -w 2 -t mangle -A TP_RULE -i br-+ -j RETURN
+ ip6tables -w 2 -t mangle -A TP_RULE -i docker+ -j RETURN
+ ip6tables -w 2 -t mangle -A TP_RULE -i veth+ -j RETURN
+ ip6tables -w 2 -t mangle -A TP_RULE -i ppp+ -j RETURN
diff --git a/v2raya2/001-fix-tproxy-cannot-work-on-openwrt-ifname-is-br-lan.patch b/v2raya2/001-fix-tproxy-cannot-work-on-openwrt-ifname-is-br-lan.patch
new file mode 100644 (file)
index 0000000..8f81c2f
--- /dev/null
@@ -0,0 +1,36 @@
+From 8325b18738061f16eeeef13a2cbe39f9f5cfec91 Mon Sep 17 00:00:00 2001
+From: mzz2017 <2017@duck.com>
+Date: Sat, 11 Feb 2023 22:54:40 +0800
+Subject: [PATCH] fix: tproxy cannot work on openwrt (ifname is br-lan)
+
+---
+ service/core/iptables/tproxy.go | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/core/iptables/tproxy.go
++++ b/core/iptables/tproxy.go
+@@ -16,7 +16,7 @@ var Tproxy tproxy
+ func (t *tproxy) AddIPWhitelist(cidr string) {
+       // avoid duplication
+       t.RemoveIPWhitelist(cidr)
+-      pos := 7
++      pos := 6
+       if configure.GetSettingNotNil().AntiPollution != configure.AntipollutionClosed {
+               pos += 3
+       }
+@@ -65,7 +65,6 @@ iptables -w 2 -t mangle -A TP_PRE -p udp
+ iptables -w 2 -t mangle -A TP_RULE -j CONNMARK --restore-mark
+ iptables -w 2 -t mangle -A TP_RULE -m mark --mark 0x40/0xc0 -j RETURN
+-iptables -w 2 -t mangle -A TP_RULE -i br-+ -j RETURN
+ iptables -w 2 -t mangle -A TP_RULE -i docker+ -j RETURN
+ iptables -w 2 -t mangle -A TP_RULE -i veth+ -j RETURN
+ iptables -w 2 -t mangle -A TP_RULE -i ppp+ -j RETURN
+@@ -125,7 +124,6 @@ ip6tables -w 2 -t mangle -A TP_PRE -p ud
+ ip6tables -w 2 -t mangle -A TP_RULE -j CONNMARK --restore-mark
+ ip6tables -w 2 -t mangle -A TP_RULE -m mark --mark 0x40/0xc0 -j RETURN
+-ip6tables -w 2 -t mangle -A TP_RULE -i br-+ -j RETURN
+ ip6tables -w 2 -t mangle -A TP_RULE -i docker+ -j RETURN
+ ip6tables -w 2 -t mangle -A TP_RULE -i veth+ -j RETURN
+ ip6tables -w 2 -t mangle -A TP_RULE -i ppp+ -j RETURN
index e22bc42..180418d 100644 (file)
@@ -1,12 +1,12 @@
 # SPDX-License-Identifier: GPL-3.0-only
 #
-# Copyright (C) 2021 ImmortalWrt.org
+# Copyright (C) 2021-2023 ImmortalWrt.org
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=v2rayA
 PKG_VERSION:=2.0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)?