fix(diagnostics): prevent sing-box listening ports check failure when IPv6 is disabled
This commit is contained in:
@@ -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 ];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user