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
It looks like currently there is no way - at least none I could find - to do a SETSOCKOPT(SO_BINDTODEV) on the underlying fd of this connection, or more specifically, to get access to the underlying fd to do so.
Proposal Details
Hi fellow Gophers,
I didn't find any open (or closed) issues for this, so
on a journey to add "VRF support" to ping_exporter, I followed the bread crumbs through go-ping and go/x/net/icmp.ListenPacket() to go/net.PacketConn.
It looks like currently there is no way - at least none I could find - to do a
SETSOCKOPT(SO_BINDTODEV)
on the underlyingfd
of this connection, or more specifically, to get access to the underlyingfd
to do so.After a bit of further digging I found change 72810: net: add ListenConfig, Dialer.Control to permit socket opts before listen/dial from 2018 (related to #9661), which adds some methods to create a
net.PacketConn
based on aListenConfig
which seems to be close what I'm looking for, however doesn't yield aicmp.PacketConn
.So I guess my proposal is to add something like
to add feature parity to the net package.
The text was updated successfully, but these errors were encountered: