diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index b53418e81..e9dde1f49 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=4.64-5 +PKG_VERSION:=4.64-6 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 3faaf807d..8291d0569 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -1389,7 +1389,7 @@ acl_app() { lua $APP_PATH/helper_dnsmasq_add.lua -FLAG ${sid} -TMP_DNSMASQ_PATH $TMP_ACL_PATH/$sid/dnsmasq.d \ -DNSMASQ_CONF_FILE $TMP_ACL_PATH/$sid/dnsmasq.conf -DEFAULT_DNS $DEFAULT_DNS -LOCAL_DNS $LOCAL_DNS \ -TUN_DNS "127.0.0.1#${_dns_port}" -REMOTE_FAKEDNS 0 -CHNROUTE_MODE_DEFAULT_DNS "${when_chnroute_default_dns:-direct}" -CHINADNS_DNS ${_china_ng_listen:-0} \ - -TCP_NODE $tcp_node -PROXY_MODE ${tcp_proxy_mode} -NO_PROXY_IPV6 ${_dnsmasq_filter_ipv6:-0} -NFTFLAG 0 \ + -TCP_NODE $tcp_node -PROXY_MODE ${tcp_proxy_mode} -NO_PROXY_IPV6 ${_dnsmasq_filter_ipv6:-0} -NFTFLAG ${nftflag:-0} \ -NO_LOGIC_LOG 1 ln_run "$(first_type dnsmasq)" "dnsmasq_${sid}" "/dev/null" -C $TMP_ACL_PATH/$sid/dnsmasq.conf -x $TMP_ACL_PATH/$sid/dnsmasq.pid eval node_${tcp_node}_$(echo -n "${tcp_proxy_mode}${remote_dns}" | md5sum | cut -d " " -f1)=${dnsmasq_port} @@ -1415,25 +1415,25 @@ acl_app() { redir_port=$(get_new_port $(expr $redir_port + 1)) eval node_${tcp_node}_redir_port=$redir_port tcp_port=$redir_port - config_file="acl/${tcp_node}_SOCKS_${socks_port}.json" local type=$(echo $(config_n_get $tcp_node type) | tr 'A-Z' 'a-z') if [ -n "${type}" ] && ([ "${type}" = "v2ray" ] || [ "${type}" = "xray" ]); then - config_file=$(echo $config_file | sed "s/SOCKS/TCP_SOCKS/g") + config_file="acl/${tcp_node}_TCP_${redir_port}.json" _extra_param="socks_address=127.0.0.1 socks_port=$socks_port" if [ "$dns_mode" = "v2ray" -o "$dns_mode" = "xray" ]; then - config_file=$(echo $config_file | sed "s/TCP_/DNS_TCP_/g") dns_port=$(get_new_port $(expr $dns_port + 1)) _dns_port=$dns_port + config_file=$(echo $config_file | sed "s/TCP_/DNS_${_dns_port}_TCP_/g") _extra_param="dns_listen_port=${_dns_port} remote_dns_protocol=${v2ray_dns_mode} remote_dns_tcp_server=${remote_dns} remote_dns_doh=${remote_dns} dns_client_ip=${dns_client_ip} dns_query_strategy=${DNS_QUERY_STRATEGY}" fi - [ "$udp_node" != "nil" ] && [ "$udp_node" = "tcp" ] && { + [ "$udp_node" != "nil" ] && ([ "$udp_node" = "tcp" ] || [ "$udp_node" = "$tcp_node" ]) && { config_file=$(echo $config_file | sed "s/TCP_/TCP_UDP_/g") _extra_param="${_extra_param} udp_redir_port=$redir_port" } config_file="$TMP_PATH/$config_file" run_v2ray flag=$tcp_node node=$tcp_node tcp_redir_port=$redir_port ${_extra_param} config_file=$config_file else + config_file="acl/${tcp_node}_SOCKS_${socks_port}.json" run_socks flag=$tcp_node node=$tcp_node bind=127.0.0.1 socks_port=$socks_port config_file=$config_file local log_file=$TMP_ACL_PATH/ipt2socks_${tcp_node}_${redir_port}.log log_file="/dev/null" @@ -1460,6 +1460,9 @@ acl_app() { udp_node=$UDP_NODE udp_port=$UDP_REDIR_PORT fi + elif [ "$udp_node" = "$tcp_node" ]; then + udp_node=$tcp_node + udp_port=$tcp_port else [ "$(config_get_type $udp_node nil)" = "nodes" ] && { if [ "$udp_node" = "$UDP_NODE" ]; then @@ -1476,14 +1479,14 @@ acl_app() { redir_port=$(get_new_port $(expr $redir_port + 1)) eval node_${udp_node}_redir_port=$redir_port udp_port=$redir_port - config_file="acl/${udp_node}_SOCKS_${socks_port}.json" local type=$(echo $(config_n_get $udp_node type) | tr 'A-Z' 'a-z') if [ -n "${type}" ] && ([ "${type}" = "v2ray" ] || [ "${type}" = "xray" ]); then - config_file=$(echo $config_file | sed "s/SOCKS/TCP_UDP_SOCKS/g") + config_file="acl/${udp_node}_UDP_${redir_port}.json" config_file="$TMP_PATH/$config_file" run_v2ray flag=$udp_node node=$udp_node udp_redir_port=$redir_port config_file=$config_file else + config_file="acl/${udp_node}_SOCKS_${socks_port}.json" run_socks flag=$udp_node node=$udp_node bind=127.0.0.1 socks_port=$socks_port config_file=$config_file local log_file=$TMP_ACL_PATH/ipt2socks_${udp_node}_${redir_port}.log log_file="/dev/null"