closeBindLocked closes the device's net.bind. The caller must hold the net mutex.
(device *Device)
| 442 | // closeBindLocked closes the device's net.bind. |
| 443 | // The caller must hold the net mutex. |
| 444 | func closeBindLocked(device *Device) error { |
| 445 | var err error |
| 446 | netc := &device.net |
| 447 | if netc.netlinkCancel != nil { |
| 448 | netc.netlinkCancel.Cancel() |
| 449 | } |
| 450 | if netc.bind != nil { |
| 451 | err = netc.bind.Close() |
| 452 | } |
| 453 | netc.stopping.Wait() |
| 454 | return err |
| 455 | } |
| 456 | |
| 457 | func (device *Device) Bind() conn.Bind { |
| 458 | device.net.Lock() |
no test coverage detected