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

Method BindSetMark

polyamide/device/device.go:463–488  ·  view source on GitHub ↗
(mark uint32)

Source from the content-addressed store, hash-verified

461}
462
463func (device *Device) BindSetMark(mark uint32) error {
464 device.net.Lock()
465 defer device.net.Unlock()
466
467 // check if modified
468 if device.net.fwmark == mark {
469 return nil
470 }
471
472 // update fwmark on existing bind
473 device.net.fwmark = mark
474 if device.isUp() && device.net.bind != nil {
475 if err := device.net.bind.SetMark(mark); err != nil {
476 return err
477 }
478 }
479
480 // clear cached source addresses
481 device.peers.RLock()
482 for _, peer := range device.peers.keyMap {
483 peer.markEndpointSrcForClearing()
484 }
485 device.peers.RUnlock()
486
487 return nil
488}
489
490func (device *Device) BindUpdate() error {
491 device.net.Lock()

Callers 1

handleDeviceLineMethod · 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 3

isUpMethod · 0.95
SetMarkMethod · 0.65

Tested by

no test coverage detected