Fixed fwmark update without device status change

An update of the fwmark was missing,
when the device was not bought up after the change.
This commit is contained in:
Mathias Hall-Andersen
2018-01-09 17:26:18 +01:00
parent 9360bac632
commit 5f01086f19
2 changed files with 9 additions and 2 deletions
+6 -2
View File
@@ -50,7 +50,9 @@ func (device *Device) RoutineTUNEventReader() {
// begin listening for incomming datagrams
logInfo.Println("Interface set up")
device.tun.isUp.Set(true)
updateBind(device)
if err := updateBind(device); err != nil {
logInfo.Println("Failed to bind UDP socket:", err)
}
}
}
@@ -59,7 +61,9 @@ func (device *Device) RoutineTUNEventReader() {
// stop listening for incomming datagrams
logInfo.Println("Interface set down")
device.tun.isUp.Set(false)
closeBind(device)
if err := closeBind(device); err != nil {
logInfo.Println("Failed to close UDP socket:", err)
}
}
}
}