closeBindLocked closes the device's net.bind. The caller must hold the net mutex.
(device *Device)
| 423 | // closeBindLocked closes the device's net.bind. |
| 424 | // The caller must hold the net mutex. |
| 425 | func closeBindLocked(device *Device) error { |
| 426 | var err error |
| 427 | netc := &device.net |
| 428 | if netc.netlinkCancel != nil { |
| 429 | netc.netlinkCancel.Cancel() |
| 430 | } |
| 431 | if netc.bind != nil { |
| 432 | err = netc.bind.Close() |
| 433 | } |
| 434 | netc.stopping.Wait() |
| 435 | return err |
| 436 | } |
| 437 | |
| 438 | func (device *Device) Bind() conn.Bind { |
| 439 | device.net.Lock() |
no test coverage detected