Skip to content

Commit 4d72198

Browse files
committed
dnsx/plus: disable use of preferred and system dns
In some cases, Plus may be used as a fallback/Default, which means that it couldn't on its own rely on other DNS transports which may require use of a fallback / Default (for instance, if the current Preferred transport is doh, then when it queries for ECH records, it does so over fallback/Default) which will infinitely loop if Plus is acting as fallback/Default and ends up selecting Preferred for the query.
1 parent 3bfc466 commit 4d72198

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

intra/dnsx/plus.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import (
2222
)
2323

2424
const plusSupportsCachedTransports = false
25+
const plusUsesPreferred = false
26+
const plusUsesSystem = false
2527

2628
const plusMaxTries = 6
2729

@@ -126,10 +128,16 @@ func (t *plus) defaultdns() (Transport, error) {
126128
}
127129

128130
func (t *plus) systemdns() (Transport, error) {
131+
if !plusUsesSystem {
132+
return nil, errNoSuchTransport
133+
}
129134
return t.r.GetInternal(System) // may return Goos or Default
130135
}
131136

132137
func (t *plus) preferreddns() (Transport, error) {
138+
if !plusUsesPreferred {
139+
return nil, errNoSuchTransport
140+
}
133141
return t.r.GetInternal(Preferred) // may return Default
134142
}
135143

0 commit comments

Comments
 (0)