An update of the fwmark was missing,
when the device was not bought up after the change.
// 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)
+ }
}
}
// 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)
+ }
}
}
}
device.net.mutex.Lock()
device.net.fwmark = uint32(fwmark)
+ if err := device.net.bind.SetMark(fwmark); err != nil {
+ logError.Println("Failed to update fwmark:", err)
+ }
device.net.mutex.Unlock()
case "public_key":