diff options
author | Josh Bleecher Snyder <josh@tailscale.com> | 2021-01-25 09:27:06 -0800 |
---|---|---|
committer | Josh Bleecher Snyder <josh@tailscale.com> | 2021-01-25 09:36:53 -0800 |
commit | d8f2cc87ee66958226157c5bb77464eee23156c2 (patch) | |
tree | fb036121c8a8e3204e29c0585d118a002ec4f762 | |
parent | 2b8665f5f973cd0b36722ba0a8689b91b99eec7d (diff) |
device: remove close processing fwmark
Also, a behavior change: Stop treating a blank value as 0.
It's not in the spec.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
-rw-r--r-- | device/uapi.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/device/uapi.go b/device/uapi.go index 69779de..196b359 100644 --- a/device/uapi.go +++ b/device/uapi.go @@ -202,22 +202,13 @@ func (device *Device) handleDeviceLine(key, value string) error { } case "fwmark": - // parse fwmark field - fwmark, err := func() (uint32, error) { - if value == "" { - return 0, nil - } - mark, err := strconv.ParseUint(value, 10, 32) - return uint32(mark), err - }() - + mark, err := strconv.ParseUint(value, 10, 32) if err != nil { return ipcErrorf(ipc.IpcErrorInvalid, "invalid fwmark: %w", err) } device.log.Debug.Println("UAPI: Updating fwmark") - - if err := device.BindSetMark(uint32(fwmark)); err != nil { + if err := device.BindSetMark(uint32(mark)); err != nil { return ipcErrorf(ipc.IpcErrorPortInUse, "failed to update fwmark: %w", err) } |