diff options
Diffstat (limited to 'conn_linux.go')
-rw-r--r-- | conn_linux.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/conn_linux.go b/conn_linux.go index 2b920bf..8d076ac 100644 --- a/conn_linux.go +++ b/conn_linux.go @@ -217,19 +217,6 @@ func (bind *NativeBind) Send(buff []byte, end Endpoint) error { } } -func rawAddrToIP4(addr *unix.SockaddrInet4) net.IP { - return net.IPv4( - addr.Addr[0], - addr.Addr[1], - addr.Addr[2], - addr.Addr[3], - ) -} - -func rawAddrToIP6(addr *unix.SockaddrInet6) net.IP { - return addr.Addr[:] -} - func (end *NativeEndpoint) SrcIP() net.IP { if !end.isV6 { return net.IPv4( @@ -624,6 +611,10 @@ func (bind *NativeBind) routineRouteListener(device *Device) { peer.mutex.RUnlock() continue } + if peer.endpoint.(*NativeEndpoint).isV6 || peer.endpoint.(*NativeEndpoint).src4().ifindex == 0 { + peer.mutex.RUnlock() + break + } nlmsg := struct { hdr unix.NlMsghdr msg unix.RtMsg |