Revert "Peer timer teardown"

This reverts commit d73f960aab.

Problems with deadlocking arises due to orphaned packets in per-peer
queues. Additional work on this issue continues in seperate branch.
This commit is contained in:
Mathias Hall-Andersen
2018-01-04 14:24:14 +01:00
parent d73f960aab
commit 9360bac632
7 changed files with 102 additions and 163 deletions
+12 -4
View File
@@ -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)
}
}
}
}