mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-07 23:41:29 +02:00
[client] Keep NetBird traffic out of third-party fwmark rules (#7314)
This commit is contained in:
@@ -21,15 +21,6 @@ func SetSocketMark(conn syscall.Conn) error {
|
||||
return setRawSocketMark(sysconn)
|
||||
}
|
||||
|
||||
// SetSocketOpt sets the SO_MARK option on the given file descriptor
|
||||
func SetSocketOpt(fd int) error {
|
||||
if !AdvancedRouting() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return setSocketOptInt(fd)
|
||||
}
|
||||
|
||||
func setRawSocketMark(conn syscall.RawConn) error {
|
||||
var setErr error
|
||||
|
||||
@@ -51,5 +42,5 @@ func setRawSocketMark(conn syscall.RawConn) error {
|
||||
}
|
||||
|
||||
func setSocketOptInt(fd int) error {
|
||||
return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_MARK, ControlPlaneMark)
|
||||
return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_MARK, int(ControlPlaneMark))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user