fix(diagnostics): prevent sing-box listening ports check failure when IPv6 is disabled

This commit is contained in:
Dushnilin
2026-09-07 17:27:29 +03:00
parent 7256814b0a
commit 394c717bf9
3 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -1633,7 +1633,8 @@ function sing_box_standard_ports_listening(netstat) {
let tproxy_suffix = ":" + SB_TPROXY_INBOUND_PORT;
let port_1602_ok = index(netstat, "0.0.0.0" + tproxy_suffix) >= 0 ||
index(netstat, "127.0.0.1" + tproxy_suffix) >= 0;
let port_1602_v6_ok = index(netstat, SB_TPROXY_INBOUND6_ADDRESS + tproxy_suffix) >= 0 ||
let port_1602_v6_ok = !core_ip.ipv6_supported() ||
index(netstat, SB_TPROXY_INBOUND6_ADDRESS + tproxy_suffix) >= 0 ||
index(netstat, "[" + SB_TPROXY_INBOUND6_ADDRESS + "]" + tproxy_suffix) >= 0 ||
index(netstat, "0:0:0:0:0:0:0:1" + tproxy_suffix) >= 0 ||
index(netstat, ":::" + SB_TPROXY_INBOUND_PORT) >= 0;
@@ -1184,6 +1184,8 @@ function add_port_matchers(rule, section) {
}
function tproxy_inbound_matcher() {
if (!core_ip.ipv6_supported())
return [ runtime_constants.TPROXY_INBOUND_TAG ];
return [ runtime_constants.TPROXY_INBOUND_TAG, runtime_constants.TPROXY_INBOUND6_TAG ];
}