Skip to content

Commit f07473e

Browse files
committed
dns53/mdns: one of v4 or v6 multicast endpoint is ok
1 parent 5e140ff commit f07473e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

intra/dns53/mdns.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ func newUnderlyingTransport(oneshot, v4, v6 bool) (*client, error) {
256256
}
257257
}
258258

259-
if (uconn4 == nil && uconn6 == nil) || (oneshot && (mconn4 == nil && mconn6 == nil)) {
259+
has4 := v4 && uconn4 != nil && (oneshot || mconn4 != nil)
260+
has6 := v6 && uconn6 != nil && (oneshot || mconn6 != nil)
261+
if !has4 && !has6 {
262+
log.E("mdns: oneshot? %t with no4? %t / no6? %t", oneshot, has4, has6)
260263
return nil, errBindFail
261264
}
262265

0 commit comments

Comments
 (0)