Work on timer teardown + bug fixes
Added waitgroups to peer struct for routine start / stop synchronisation
This commit is contained in:
parent
d73f960aab
commit
1dd590b91b
8 changed files with 102 additions and 47 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue