🏅 Sync 2023-02-20 20:39:05

This commit is contained in:
github-actions[bot] 2023-02-20 20:39:05 +08:00
parent e9edf1ac2f
commit a69608fdf2
4 changed files with 17 additions and 12 deletions

View File

@ -17,6 +17,11 @@ get_config() {
config_get allow_wan $1 allow_wan 0
config_load network
config_get lan_addr lan ipaddr "0.0.0.0"
if echo "${lan_addr}" | grep -Fq ' '; then
lan_addr="0.0.0.0"
else
lan_addr=${lan_addr%%/*}
fi
}
set_firewall() {

View File

@ -50,7 +50,7 @@ fw_reinit() {
}
flush_rules() {
iptables-save -c | grep -v "SS_SPEC" | sed '/[^ ]--/d' | uniq | iptables-restore -c
iptables-save -c | grep -v "SS_SPEC" | sed '/[^ ]--/d' | uniq | iptables-restore -w -c
uci -q show firewall | sed -n 's/.*path=//p' | sed -n '/gargoyle/p' | tr -d \' | while read init; do
sh $init restart >/dev/null 2>&1
done
@ -87,7 +87,7 @@ EOF
ipt_nat() {
include_ac_rules nat
ipt="iptables -t nat"
ipt="iptables -w -t nat"
$ipt -A SS_SPEC_WAN_FW -p tcp \
-j REDIRECT --to-ports $local_port || return 1
if [ -n "$OUTPUT" ]; then
@ -108,7 +108,7 @@ ipt_mangle() {
ip rule add fwmark 1 lookup 100
ip route add local default dev lo table 100
include_ac_rules mangle
iptables -t mangle -A SS_SPEC_WAN_FW -p udp \
iptables -w -t mangle -A SS_SPEC_WAN_FW -p udp \
-j TPROXY --on-port $LOCAL_PORT --tproxy-mark 0x01/0x01
return $?
}
@ -116,9 +116,9 @@ ipt_mangle() {
export_ipt_rules() {
[ -n "$FWI" ] || return 0
cat <<-CAT >>$FWI
iptables-save -c | grep -v "SS_SPEC" | sed '/[^ ]--/d' | uniq | iptables-restore -c
iptables-save -c | grep -v "SS_SPEC" | sed '/[^ ]--/d' | uniq | iptables-restore -w -c
iptables-restore -n <<-EOF
iptables-restore -w -n <<-EOF
$(iptables-save | grep -E "SS_SPEC|^\*|^COMMIT" |\
sed -e "s/^-A \(OUTPUT\|PREROUTING\)/-I \1 1/")
EOF
@ -176,7 +176,7 @@ EOF
include_ac_rules() {
ipt_chain=$1
local protocol=$([ "$1" = "mangle" ] && echo udp || echo tcp)
iptables-restore -n <<-EOF
iptables-restore -w -n <<-EOF
*$1
:SS_SPEC_LAN_DG - [0:0]
:SS_SPEC_LAN_AC - [0:0]
@ -196,8 +196,8 @@ include_ac_rules() {
EOF
if [ "Z${WAN_BP_LIST}" = "Z/dev/flag_gfwlist" ]; then
[ $(ipset list -n | grep -c gfwlist) -lt 1 ] && /etc/init.d/dnsmasq-extra restart
idx=$(($(iptables -t $ipt_chain -L SS_SPEC_WAN_AC | grep all | sed -n -e '/ss_spec_dst_bp/=') +1))
iptables -t $ipt_chain -I SS_SPEC_WAN_AC $idx -m set ! --match-set gfwlist dst -j RETURN
idx=$(($(iptables -w -t $ipt_chain -L SS_SPEC_WAN_AC | grep all | sed -n -e '/ss_spec_dst_bp/=') +1))
iptables -w -t $ipt_chain -I SS_SPEC_WAN_AC $idx -m set ! --match-set gfwlist dst -j RETURN
fi
}

View File

@ -6,8 +6,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sing-box
PKG_VERSION:=1.2-beta2
PKG_RELEASE:=28
PKG_VERSION:=1.2-beta3
PKG_RELEASE:=29
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)?

View File

@ -6,8 +6,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-plugin
PKG_VERSION:=5.3.0
PKG_RELEASE:=67
PKG_VERSION:=5.4.0
PKG_RELEASE:=68
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)?