diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-14 12:27:29 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-14 12:27:29 +0200 |
commit | 355e9bd619c8ec8bdd0f2934739a87a15ceb6920 (patch) | |
tree | 36dfb2a5d34e63873281f1d6ed23ca6eaf34a425 /conn_linux.go | |
parent | 8b30278ce666a74b46f607b47bf3fbe87744c016 (diff) |
Clean more
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 |