feat(xray): accept the TUN WFP leak ports of xray-core 26.10.31

xray-core 26.10.31 (#7288) widened a TUN inbound's
autoSystemWfpBlockLeak: "dns" now also blocks DNS over TLS/QUIC (port
853), "windnsclient" covers only Windows' DNS Client service, and any
"tcp/<port>" or "udp/<port>" keeps that port inside the TUN. Anything
else, such as "tcp/0" or "icmp/1", stops the core at startup.

The form offers windnsclient and takes typed port values, the hint
explains them in all 14 locales, and the inbound and template save
paths run the core's own ExpandWfpBlockLeak so a value it refuses is
refused at save instead of taking every inbound down.
This commit is contained in:
MHSanaei
2026-11-01 14:56:13 +01:00
parent ba27b74be8
commit 87749c1ee4
21 changed files with 83 additions and 17 deletions
+19
View File
@@ -7,6 +7,7 @@ import (
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
"github.com/mhsanaei/3x-ui/v3/internal/util/common"
"github.com/mhsanaei/3x-ui/v3/internal/util/version"
"github.com/mhsanaei/3x-ui/v3/internal/xray"
"gorm.io/gorm"
)
@@ -161,3 +162,21 @@ func streamSupportsFallbacks(streamSettings string) bool {
}
return stream.Security == "tls" || stream.Security == "reality"
}
// validateTunWfpBlockLeak refuses at save the autoSystemWfpBlockLeak values xray-core 26.10.31
// (#7288) refuses when the core starts, which stops every inbound with it.
func validateTunWfpBlockLeak(protocol, settings string) error {
if protocol != "tun" {
return nil
}
var tunSettings struct {
AutoSystemWfpBlockLeak []string `json:"autoSystemWfpBlockLeak"`
}
if json.Unmarshal([]byte(settings), &tunSettings) != nil {
return nil
}
if err := xray.ValidateTunWfpBlockLeak(tunSettings.AutoSystemWfpBlockLeak); err != nil {
return common.NewError("TUN autoSystemWfpBlockLeak: ", err)
}
return nil
}