mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-13 14:43:19 +00:00
wgengine/{monitor,router}: restore Linux ip rules when systemd deletes them
Thanks. Fixes #1591 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
0aa77ba80f
commit
e4fecfe31d
@@ -79,6 +79,16 @@ func (b *AtomicBool) Set(v bool) {
|
||||
atomic.StoreInt32((*int32)(b), n)
|
||||
}
|
||||
|
||||
// Swap sets b to v and reports whether it changed.
|
||||
func (b *AtomicBool) Swap(v bool) (changed bool) {
|
||||
var n int32
|
||||
if v {
|
||||
n = 1
|
||||
}
|
||||
old := atomic.SwapInt32((*int32)(b), n)
|
||||
return old != n
|
||||
}
|
||||
|
||||
func (b *AtomicBool) Get() bool {
|
||||
return atomic.LoadInt32((*int32)(b)) != 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user