Clean more
This commit is contained in:
parent
8b30278ce6
commit
355e9bd619
7 changed files with 52 additions and 65 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue