You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal/socket: use interface not type assertions to infer a wrapped net.Conn's kind
When passing a wrapped connection to ipv{4,6}.NewPacketConn, calls to
ReadBatch will fail with an invalid connection error. This is because
NewConn performs a type assertion to determine the type (TCP, UDP, IP)
of the net.Conn.
In order to allow for wrapped connections to be passed to NewConn, we
can use an interface assertion that checks for methods on the net.Conn
that are unique to TCP, UDP and IP.
Fixesgolang/go#42444.
Change-Id: I07cdb037829643f5cf4cd77105a772fcff8c4b2a
Reviewed-on: https://go-review.googlesource.com/c/net/+/271927
Reviewed-by: Emmanuel Odeke <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Emmanuel Odeke <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Trust: Daniel Martí <[email protected]>
0 commit comments