Skip to content

Commit c032dde

Browse files
committed
1 parent c2c17a7 commit c032dde

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

luci-app-openclash/root/etc/init.d/openclash

-13
Original file line numberDiff line numberDiff line change
@@ -1558,10 +1558,8 @@ if [ -n "$FW4" ]; then
15581558
nft 'add chain inet fw4 openclash_upnp'
15591559
nft 'flush chain inet fw4 openclash_upnp'
15601560
upnp_exclude
1561-
nft 'add rule inet fw4 openclash_mangle meta l4proto { udp } iifname lo counter return'
15621561
nft 'add rule inet fw4 openclash_mangle ip daddr @localnetwork counter return'
15631562
nft 'add rule inet fw4 openclash_mangle ct direction reply counter return'
1564-
nft 'add rule inet fw4 openclash_mangle udp dport 53 counter return'
15651563
if [ "$en_mode" = "fake-ip" ]; then
15661564
nft add rule inet fw4 openclash_mangle meta l4proto { udp } ip daddr { "$fakeip_range" } mark set "$PROXY_FWMARK" tproxy ip to 127.0.0.1:"$tproxy_port" counter accept
15671565
fi
@@ -1598,7 +1596,6 @@ if [ -n "$FW4" ]; then
15981596
ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE"
15991597
nft 'add chain inet fw4 openclash_mangle'
16001598
nft 'flush chain inet fw4 openclash_mangle'
1601-
nft 'add rule inet fw4 openclash_mangle meta l4proto { udp } iifname lo counter return'
16021599
nft add rule inet fw4 openclash_mangle meta l4proto { udp } ip daddr { "$fakeip_range" } mark set "$PROXY_FWMARK" tproxy ip to 127.0.0.1:"$tproxy_port" counter accept 2>/dev/null
16031600
nft 'add rule inet fw4 mangle_prerouting meta nfproto {ipv4} ip protocol udp counter jump openclash_mangle'
16041601
fi
@@ -1889,10 +1886,8 @@ if [ -n "$FW4" ]; then
18891886
if [ "$enable_v6_udp_proxy" -eq 1 ] || [ "$ipv6_mode" -ne 1 ]; then
18901887
nft 'add chain inet fw4 openclash_mangle_v6'
18911888
nft 'flush chain inet fw4 openclash_mangle_v6'
1892-
nft 'add rule inet fw4 openclash_mangle_v6 meta nfproto {ipv6} udp iifname lo counter return'
18931889
nft 'add rule inet fw4 openclash_mangle_v6 ip6 daddr @localnetwork6 counter return'
18941890
nft 'add rule inet fw4 openclash_mangle_v6 ct direction reply counter return'
1895-
nft 'add rule inet fw4 openclash_mangle_v6 meta nfproto {ipv6} udp dport 53 counter return'
18961891
nft 'add rule inet fw4 openclash_mangle_v6 ip6 daddr @wan_ac_black_ipv6s counter return'
18971892

18981893
if [ "$en_mode" == "redir-host" ]; then
@@ -2300,11 +2295,8 @@ if [ -z "$FW4" ]; then
23002295
iptables -t mangle -N openclash_upnp
23012296
iptables -t mangle -F openclash_upnp
23022297
upnp_exclude
2303-
#prevent tproxy loop
2304-
iptables -t mangle -A openclash -i lo -j RETURN
23052298
iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN
23062299
iptables -t mangle -A openclash -m conntrack --ctdir REPLY -j RETURN
2307-
iptables -t mangle -A openclash -p udp --dport 53 -j RETURN >/dev/null 2>&1
23082300
if [ "$en_mode" = "fake-ip" ]; then
23092301
iptables -t mangle -A openclash -p udp -d "$fakeip_range" -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK"
23102302
fi
@@ -2340,8 +2332,6 @@ if [ -z "$FW4" ]; then
23402332
ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE"
23412333
iptables -t mangle -N openclash
23422334
iptables -t mangle -F openclash
2343-
#prevent tproxy loop
2344-
iptables -t mangle -A openclash -i lo -j RETURN
23452335
iptables -t mangle -A openclash -p udp -d "$fakeip_range" -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK"
23462336
iptables -t mangle -A PREROUTING -p udp -j openclash
23472337
fi
@@ -2639,11 +2629,8 @@ if [ -z "$FW4" ]; then
26392629
if [ "$enable_v6_udp_proxy" -eq 1 ] || [ "$ipv6_mode" -ne 1 ]; then
26402630
ip6tables -t mangle -N openclash
26412631
ip6tables -t mangle -F openclash
2642-
#prevent tproxy loop
2643-
ip6tables -t mangle -A openclash -i lo -j RETURN
26442632
ip6tables -t mangle -A openclash -m set --match-set localnetwork6 dst -j RETURN
26452633
ip6tables -t mangle -A openclash -m conntrack --ctdir REPLY -j RETURN
2646-
ip6tables -t mangle -A openclash -p udp --dport 53 -j RETURN
26472634
ip6tables -t mangle -A openclash -m set --match-set wan_ac_black_ipv6s dst -j RETURN >/dev/null 2>&1
26482635
ip6tables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1
26492636
ip6tables -t mangle -A openclash -m set --match-set lan_ac_black_ipv6s src -j RETURN >/dev/null 2>&1

0 commit comments

Comments
 (0)