Seperated fwmark update code into function
This commit is contained in:
parent
8f1d1b8c54
commit
9de17e6c9c
2 changed files with 34 additions and 9 deletions
6
uapi.go
6
uapi.go
|
|
@ -191,11 +191,7 @@ func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError {
|
|||
|
||||
logDebug.Println("UAPI: Updating fwmark")
|
||||
|
||||
device.net.mutex.Lock()
|
||||
device.net.fwmark = uint32(fwmark)
|
||||
device.net.mutex.Unlock()
|
||||
|
||||
if err := device.BindUpdate(); err != nil {
|
||||
if err := device.BindSetMark(uint32(fwmark)); err != nil {
|
||||
logError.Println("Failed to update fwmark:", err)
|
||||
return &IPCError{Code: ipcErrorPortInUse}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue