Work on timer teardown + bug fixes

Added waitgroups to peer struct for routine
start / stop synchronisation
This commit is contained in:
Mathias Hall-Andersen 2018-01-13 09:00:37 +01:00
parent d73f960aab
commit 1dd590b91b
8 changed files with 102 additions and 47 deletions

View file

@ -45,14 +45,14 @@ func (device *Device) RoutineTUNEventReader() {
}
}
if event&TUNEventUp != 0 {
if event&TUNEventUp != 0 && !device.isUp.Get() {
logInfo.Println("Interface set up")
device.Up()
}
if event&TUNEventDown != 0 {
if event&TUNEventDown != 0 && device.isUp.Get() {
logInfo.Println("Interface set down")
device.Up()
device.Down()
}
}
}