diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-01-04 14:24:14 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-01-04 14:24:14 +0100 |
commit | 9360bac63290d7869c07c0d1ba40f3f34fd39b83 (patch) | |
tree | 458d8349b53eb9b6a9f9d0fdd364a43ac10b96c5 /src/tun.go | |
parent | d73f960aab86b9a12b0b7d18aa80ce1d4f130695 (diff) |
Revert "Peer timer teardown"
This reverts commit d73f960aab86b9a12b0b7d18aa80ce1d4f130695.
Problems with deadlocking arises due to orphaned packets in per-peer
queues. Additional work on this issue continues in seperate branch.
Diffstat (limited to 'src/tun.go')
-rw-r--r-- | src/tun.go | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -46,13 +46,21 @@ func (device *Device) RoutineTUNEventReader() { } if event&TUNEventUp != 0 { - logInfo.Println("Interface set up") - device.Up() + if !device.tun.isUp.Get() { + // begin listening for incomming datagrams + logInfo.Println("Interface set up") + device.tun.isUp.Set(true) + updateBind(device) + } } if event&TUNEventDown != 0 { - logInfo.Println("Interface set down") - device.Up() + if device.tun.isUp.Get() { + // stop listening for incomming datagrams + logInfo.Println("Interface set down") + device.tun.isUp.Set(false) + closeBind(device) + } } } } |