diff --git a/src/core/debug.go b/src/core/debug.go index 0fc08259..eb406798 100644 --- a/src/core/debug.go +++ b/src/core/debug.go @@ -1,3 +1,4 @@ +//go:build debug // +build debug package core diff --git a/src/core/tcp_darwin.go b/src/core/tcp_darwin.go index 6b85c621..2ea3abc8 100644 --- a/src/core/tcp_darwin.go +++ b/src/core/tcp_darwin.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package core diff --git a/src/core/tcp_linux.go b/src/core/tcp_linux.go index 558b4e56..e59c3121 100644 --- a/src/core/tcp_linux.go +++ b/src/core/tcp_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package core diff --git a/src/core/tcp_other.go b/src/core/tcp_other.go index 97b81ed1..8dd76f28 100644 --- a/src/core/tcp_other.go +++ b/src/core/tcp_other.go @@ -1,3 +1,4 @@ +//go:build !darwin && !linux // +build !darwin,!linux package core diff --git a/src/defaults/defaults_darwin.go b/src/defaults/defaults_darwin.go index e16f398f..060ce814 100644 --- a/src/defaults/defaults_darwin.go +++ b/src/defaults/defaults_darwin.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package defaults diff --git a/src/defaults/defaults_freebsd.go b/src/defaults/defaults_freebsd.go index 6c3e1c60..84df48ad 100644 --- a/src/defaults/defaults_freebsd.go +++ b/src/defaults/defaults_freebsd.go @@ -1,3 +1,4 @@ +//go:build freebsd // +build freebsd package defaults diff --git a/src/defaults/defaults_linux.go b/src/defaults/defaults_linux.go index 95c7ae95..c7f5f119 100644 --- a/src/defaults/defaults_linux.go +++ b/src/defaults/defaults_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package defaults diff --git a/src/defaults/defaults_openbsd.go b/src/defaults/defaults_openbsd.go index ef339546..0ec877ca 100644 --- a/src/defaults/defaults_openbsd.go +++ b/src/defaults/defaults_openbsd.go @@ -1,3 +1,4 @@ +//go:build openbsd // +build openbsd package defaults diff --git a/src/defaults/defaults_other.go b/src/defaults/defaults_other.go index d1417322..37637425 100644 --- a/src/defaults/defaults_other.go +++ b/src/defaults/defaults_other.go @@ -1,3 +1,4 @@ +//go:build !linux && !darwin && !windows && !openbsd && !freebsd // +build !linux,!darwin,!windows,!openbsd,!freebsd package defaults diff --git a/src/defaults/defaults_windows.go b/src/defaults/defaults_windows.go index e81d09cf..c1ea9689 100644 --- a/src/defaults/defaults_windows.go +++ b/src/defaults/defaults_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package defaults diff --git a/src/ipv6rwc/ipv6rwc.go b/src/ipv6rwc/ipv6rwc.go index 1c715f0f..fc2a688f 100644 --- a/src/ipv6rwc/ipv6rwc.go +++ b/src/ipv6rwc/ipv6rwc.go @@ -132,6 +132,7 @@ func (k *keyStore) update(key ed25519.PublicKey) *keyInfo { var kArray keyArray copy(kArray[:], key) var info *keyInfo + var packets [][]byte if info = k.keyToInfo[kArray]; info == nil { info = new(keyInfo) info.key = kArray @@ -140,19 +141,19 @@ func (k *keyStore) update(key ed25519.PublicKey) *keyInfo { k.keyToInfo[info.key] = info k.addrToInfo[info.address] = info k.subnetToInfo[info.subnet] = info - k.resetTimeout(info) - k.mutex.Unlock() if buf := k.addrBuffer[info.address]; buf != nil { - k.core.WriteTo(buf.packet, iwt.Addr(info.key[:])) + packets = append(packets, buf.packet) delete(k.addrBuffer, info.address) } if buf := k.subnetBuffer[info.subnet]; buf != nil { - k.core.WriteTo(buf.packet, iwt.Addr(info.key[:])) + packets = append(packets, buf.packet) delete(k.subnetBuffer, info.subnet) } - } else { - k.resetTimeout(info) - k.mutex.Unlock() + } + k.resetTimeout(info) + k.mutex.Unlock() + for _, packet := range packets { + k.core.WriteTo(packet, iwt.Addr(info.key[:])) } return info } diff --git a/src/multicast/multicast_darwin.go b/src/multicast/multicast_darwin.go index e7075c0a..7ad0c543 100644 --- a/src/multicast/multicast_darwin.go +++ b/src/multicast/multicast_darwin.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package multicast diff --git a/src/multicast/multicast_other.go b/src/multicast/multicast_other.go index dfcf625f..9977951c 100644 --- a/src/multicast/multicast_other.go +++ b/src/multicast/multicast_other.go @@ -1,3 +1,4 @@ +//go:build !linux && !darwin && !netbsd && !freebsd && !openbsd && !dragonflybsd && !windows // +build !linux,!darwin,!netbsd,!freebsd,!openbsd,!dragonflybsd,!windows package multicast diff --git a/src/multicast/multicast_unix.go b/src/multicast/multicast_unix.go index 1ff48b17..9c822fcf 100644 --- a/src/multicast/multicast_unix.go +++ b/src/multicast/multicast_unix.go @@ -1,3 +1,4 @@ +//go:build linux || netbsd || freebsd || openbsd || dragonflybsd // +build linux netbsd freebsd openbsd dragonflybsd package multicast diff --git a/src/multicast/multicast_windows.go b/src/multicast/multicast_windows.go index 3666faaa..515412a4 100644 --- a/src/multicast/multicast_windows.go +++ b/src/multicast/multicast_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package multicast diff --git a/src/tuntap/tun_bsd.go b/src/tuntap/tun_bsd.go index 75158857..fe36266b 100644 --- a/src/tuntap/tun_bsd.go +++ b/src/tuntap/tun_bsd.go @@ -1,3 +1,4 @@ +//go:build openbsd || freebsd // +build openbsd freebsd package tuntap diff --git a/src/tuntap/tun_darwin.go b/src/tuntap/tun_darwin.go index 75938881..6f6e2528 100644 --- a/src/tuntap/tun_darwin.go +++ b/src/tuntap/tun_darwin.go @@ -1,3 +1,4 @@ +//go:build !mobile // +build !mobile package tuntap diff --git a/src/tuntap/tun_linux.go b/src/tuntap/tun_linux.go index 0a845368..f849c00f 100644 --- a/src/tuntap/tun_linux.go +++ b/src/tuntap/tun_linux.go @@ -1,3 +1,4 @@ +//go:build !mobile // +build !mobile package tuntap diff --git a/src/tuntap/tun_other.go b/src/tuntap/tun_other.go index c0321267..8ce24953 100644 --- a/src/tuntap/tun_other.go +++ b/src/tuntap/tun_other.go @@ -1,3 +1,4 @@ +//go:build !linux && !darwin && !windows && !openbsd && !freebsd && !mobile // +build !linux,!darwin,!windows,!openbsd,!freebsd,!mobile package tuntap diff --git a/src/tuntap/tun_windows.go b/src/tuntap/tun_windows.go index 7b7ee710..8dce7274 100644 --- a/src/tuntap/tun_windows.go +++ b/src/tuntap/tun_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package tuntap