1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix v2ray support and eBPF pre-support

This commit is contained in:
Ycarus 2019-01-26 13:52:55 +01:00
parent 58b4ff3198
commit 5df9ee2856
4 changed files with 10 additions and 894 deletions

View file

@ -121,7 +121,7 @@ ss_rules_parse_args() {
ss_rules_flush() {
local setname
iptables-save --counters | grep -v ss_rules_ | iptables-restore --counters
iptables-save --counters | grep -v ss_rules_ | iptables-restore -w --counters
while ip rule del fwmark 1 lookup 100 2>/dev/null; do true; done
ip route flush table 100
for setname in $(ipset -n list | grep "ss_rules_"); do
@ -165,7 +165,7 @@ ss_rules_iptchains_init() {
}
ss_rules_iptchains_init_mark() {
iptables-restore --noflush <<-EOF
iptables-restore -w --noflush <<-EOF
*mangle
-A PREROUTING -m set --match-set ss_rules_dst_bypass_all dst -j MARK --set-mark 0x539
COMMIT
@ -185,7 +185,7 @@ ss_rules_iptchains_init_tcp() {
bypass|*) return 0;;
esac
iptables-restore --noflush <<-EOF
iptables-restore -w --noflush <<-EOF
*nat
:ss_rules_local_out -
-I OUTPUT 1 -p tcp -j ss_rules_local_out
@ -240,7 +240,7 @@ ss_rules_iptchains_init_() {
forward) dst_default_target=ss_rules_forward ;;
bypass|*) dst_default_target=RETURN ;;
esac
sed -e '/^\s*$/d' -e 's/^\s\+//' <<-EOF | iptables-restore --noflush
sed -e '/^\s*$/d' -e 's/^\s\+//' <<-EOF | iptables-restore -w --noflush
*$table
:ss_rules_pre_src -
:ss_rules_src -

View file

@ -103,7 +103,7 @@ ss_rules6_parse_args() {
ss_rules6_flush() {
local setname
ip6tables-save --counters | grep -v ss_rules6_ | ip6tables-restore --counters
ip6tables-save --counters | grep -v ss_rules6_ | ip6tables-restore -w --counters
while ip -f inet6 rule del fwmark 1 lookup 100 2>/dev/null; do true; done
ip -f inet6 route flush table 100
for setname in $(ipset -n list | grep "ss_rules6_"); do
@ -147,7 +147,7 @@ ss_rules6_iptchains_init() {
}
ss_rules6_iptchains_init_mark() {
ip6tables-restore --noflush <<-EOF
ip6tables-restore -w --noflush <<-EOF
*mangle
-A PREROUTING -m set --match-set ss_rules6_dst_bypass_all dst -j MARK --set-mark 0x6539
COMMIT
@ -168,7 +168,7 @@ ss_rules6_iptchains_init_tcp() {
bypass|*) return 0;;
esac
ip6tables-restore --noflush <<-EOF
ip6tables-restore -w --noflush <<-EOF
*nat
:ss_rules6_local_out -
-I OUTPUT 1 -p tcp -j ss_rules6_local_out
@ -224,7 +224,7 @@ ss_rules6_iptchains_init_() {
forward) dst_default_target=ss_rules6_forward ;;
bypass|*) dst_default_target=RETURN ;;
esac
sed -e '/^\s*$/d' -e 's/^\s\+//' <<-EOF | ip6tables-restore --noflush
sed -e '/^\s*$/d' -e 's/^\s\+//' <<-EOF | ip6tables-restore -w --noflush
*$table
:ss_rules6_pre_src -
:ss_rules6_src -