User cookie is closer to fwmark than setfib

This commit is contained in:
Jason A. Donenfeld 2018-05-21 20:13:39 +02:00
parent 2ae22ac65d
commit 1c666576d5

View file

@ -151,10 +151,10 @@ func (bind *NativeBind) SetMark(mark uint32) error {
return err2
}
err3 := fd4.Control(func(fd uintptr) {
err1 = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, 0x1014 /* unix.SO_SETFIB */, int(mark))
err1 = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, 0x1015 /* unix.SO_USER_COOKIE */, int(mark))
})
err4 := fd6.Control(func(fd uintptr) {
err2 = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, 0x1014 /* unix.SO_SETFIB */, int(mark))
err2 = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, 0x1015 /* unix.SO_USER_COOKIE */, int(mark))
})
if err1 != nil {
return err1