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

Merge pull request #332 from Ysurac/develop

sync
This commit is contained in:
suyuan 2023-07-22 13:10:04 +08:00 committed by GitHub
commit f18992359e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 4 deletions

View file

@ -22,7 +22,7 @@ o = s:option(ListValue, "mptcp_path_manager", translate("Multipath TCP path-mana
o:value("default", translate("default"))
o:value("fullmesh", "fullmesh")
--if tonumber(uname.release:sub(1,4)) <= 5.15 then
if uname.release:sub(1,4) ~= "5.15" or uname.release:sub(1,1) ~= "6" then
if uname.release:sub(1,4) ~= "5.15" and uname.release:sub(1,1) ~= "6" then
o:value("ndiffports", "ndiffports")
o:value("binder", "binder")
if uname.release:sub(1,4) ~= "4.14" then
@ -32,7 +32,7 @@ end
o = s:option(ListValue, "mptcp_scheduler", translate("Multipath TCP scheduler"))
o:value("default", translate("default"))
-- if tonumber(uname.release:sub(1,4)) <= 5.15 then
if uname.release:sub(1,4) ~= "5.15" or uname.release:sub(1,1) ~= "6" then
if uname.release:sub(1,4) ~= "5.15" and uname.release:sub(1,1) ~= "6" then
o:value("roundrobin", "round-robin")
o:value("redundant", "redundant")
if uname.release:sub(1,4) ~= "4.14" then
@ -41,13 +41,13 @@ if uname.release:sub(1,4) ~= "5.15" or uname.release:sub(1,1) ~= "6" then
end
end
-- if tonumber(uname.release:sub(1,4)) <= 5.15 then
if uname.release:sub(1,4) ~= "5.15" or uname.release:sub(1,1) ~= "6" then
if uname.release:sub(1,4) ~= "5.15" and uname.release:sub(1,1) ~= "6" then
o = s:option(Value, "mptcp_syn_retries", translate("Multipath TCP SYN retries"))
o.datatype = "uinteger"
o.rmempty = false
end
-- if tonumber(uname.release:sub(1,4)) <= 5.15 then
if uname.release:sub(1,4) ~= "5.15" or uname.release:sub(1,1) ~= "6" then
if uname.release:sub(1,4) ~= "5.15" and uname.release:sub(1,1) ~= "6" then
o = s:option(ListValue, "mptcp_version", translate("Multipath TCP version"))
o:value(0, translate("0"))
o:value(1, translate("1"))

View file

@ -956,6 +956,18 @@ _vps_firewall_redirect_port() {
[ -n "$src_dip" ] && {
comment=" to $src_dip"
$IPTABLESSAVE --counters | sed "s:-d $src_dip/32::g" | $IPTABLESRESTORE -w
[ -f /usr/sbin/nft ] && {
rule=$(nft -a list table inet fw4 | grep -m1 "ip daddr $src_dip")
[ -n "$rule" ] && {
handle=$(echo $rule | awk '{ print $NF }')
nft replace rule inet fw4 dstnat_lan handle ${handle} $(echo $rule | awk '{ sub(" comment.*$",""); print }' | sed "s/ip daddr ${src_dip}//") 2>&1 >/dev/null
}
rule=$(nft -a list table inet fw4 | grep -m1 "ip daddr $src_dip")
[ -n "$rule" ] && {
handle=$(echo $rule | awk '{ print $NF }')
nft replace rule inet fw4 dstnat_vpn handle $handle $(echo $rule | awk '{ sub(" comment.*$",""); print }' | sed "s/ip daddr ${src_dip}/meta nfproto ipv4/") 2>&1 >/dev/null
}
}
}
[ -n "$src_ip" ] && comment=" from $src_ip"
if [ "$target" = "ACCEPT" ]; then
@ -1038,6 +1050,18 @@ _vps_firewall_redirect_port() {
[ -n "$src_dip" ] && {
comment=" to $src_dip"
$IPTABLESSAVE --counters | sed "s:-d $src_dip/32::g" | $IPTABLESRESTORE -w
[ -f /usr/sbin/nft ] && {
rule=$(nft -a list table inet fw4 | grep -m1 "ip daddr $src_dip")
[ -n "$rule" ] && {
handle=$(echo $rule | awk '{ print $NF }')
nft replace rule inet fw4 dstnat_lan handle ${handle} $(echo $rule | awk '{ sub(" comment.*$",""); print }' | sed "s/ip daddr ${src_dip}//") 2>&1 >/dev/null
}
rule=$(nft -a list table inet fw4 | grep -m1 "ip daddr $src_dip")
[ -n "$rule" ] && {
handle=$(echo $rule | awk '{ print $NF }')
nft replace rule inet fw4 dstnat_vpn handle $handle $(echo $rule | awk '{ sub(" comment.*$",""); print }' | sed "s/ip daddr ${src_dip}/meta nfproto ipv4/") 2>&1 >/dev/null
}
}
}
[ -n "$src_ip" ] && comment=" from $src_ip"
checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}")