mirror of
https://github.com/slackhq/nebula.git
synced 2026-08-15 14:57:01 +02:00
tun_linux: use IFF_TUN_EXCL to prevent multiple nebulas
This commit is contained in:
@@ -157,7 +157,8 @@ func offloadUSOEnabled(offloadFlags uint) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newTun(c *config.C, l *slog.Logger, vpnNetworks []netip.Prefix, multiqueue bool) (*tun, error) {
|
func newTun(c *config.C, l *slog.Logger, vpnNetworks []netip.Prefix, multiqueue bool) (*tun, error) {
|
||||||
baseFlags := uint16(unix.IFF_TUN | unix.IFF_NO_PI)
|
// IFF_TUN_EXCL prevents us from attaching to an already-running tun
|
||||||
|
baseFlags := uint16(unix.IFF_TUN | unix.IFF_NO_PI | unix.IFF_TUN_EXCL)
|
||||||
if multiqueue {
|
if multiqueue {
|
||||||
baseFlags |= unix.IFF_MULTI_QUEUE
|
baseFlags |= unix.IFF_MULTI_QUEUE
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user