conn: close ipv4 socket when ipv6 socket fails
This commit is contained in:
parent
3e8f2e3fa5
commit
f7f63765d1
|
@ -111,7 +111,6 @@ func CreateBind(uport uint16, device *Device) (Bind, uint16, error) {
|
|||
|
||||
bind.ipv6, port, err = listenNet("udp6", port)
|
||||
if err != nil && extractErrno(err) != syscall.EAFNOSUPPORT {
|
||||
return nil, 0, err
|
||||
bind.ipv4.Close()
|
||||
bind.ipv4 = nil
|
||||
return nil, 0, err
|
||||
|
|
Loading…
Reference in a new issue