mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-29 10:11:52 +03:00
Report invalid DNS address early
This commit is contained in:
@@ -54,7 +54,9 @@ func NewTLS(ctx context.Context, logger log.ContextLogger, tag string, options o
|
||||
return nil, err
|
||||
}
|
||||
serverAddr := options.DNSServerAddressOptions.Build()
|
||||
if serverAddr.Port == 0 {
|
||||
if !serverAddr.Addr.IsValid() {
|
||||
return nil, E.New("invalid server address: ", serverAddr)
|
||||
} else if serverAddr.Port == 0 {
|
||||
serverAddr.Port = 853
|
||||
}
|
||||
return &TLSTransport{
|
||||
|
||||
Reference in New Issue
Block a user