MCPcopy Create free account
hub / github.com/encodeous/nylon / downLocked

Method downLocked

polyamide/device/device.go:200–212  ·  view source on GitHub ↗

downLocked attempts to bring the device down. The caller must hold device.state.mu and is responsible for updating device.state.state.

()

Source from the content-addressed store, hash-verified

198// downLocked attempts to bring the device down.
199// The caller must hold device.state.mu and is responsible for updating device.state.state.
200func (device *Device) downLocked() error {
201 err := device.BindClose()
202 if err != nil {
203 device.Log.Errorf("Bind close failed: %v", err)
204 }
205
206 device.peers.RLock()
207 for _, peer := range device.peers.keyMap {
208 peer.Stop()
209 }
210 device.peers.RUnlock()
211 return err
212}
213
214func (device *Device) Up() error {
215 return device.changeState(deviceStateUp)

Callers 2

changeStateMethod · 0.95
CloseMethod · 0.95

Implementers 4

NativeTunpolyamide/tun/tun_linux.go
netTunpolyamide/tun/netstack/tun.go
chTunpolyamide/tun/tuntest/tuntest.go
fakeTUNDeviceSizedpolyamide/device/device_test.go

Calls 2

BindCloseMethod · 0.95
StopMethod · 0.65

Tested by

no test coverage detected