mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
Fix data race on peermacs
This commit is contained in:
parent
e8272926a4
commit
a10c141896
2 changed files with 11 additions and 3 deletions
|
@ -313,6 +313,14 @@ func (i *ICMPv6) Solicit(addr address.Address) {
|
|||
}
|
||||
}
|
||||
|
||||
func (i *ICMPv6) getNeighbor(addr address.Address) (neighbor, bool) {
|
||||
i.peermacsmutex.RLock()
|
||||
defer i.peermacsmutex.RUnlock()
|
||||
|
||||
n, ok := i.peermacs[addr]
|
||||
return n, ok
|
||||
}
|
||||
|
||||
func (i *ICMPv6) createNDPL2(dst address.Address) ([]byte, error) {
|
||||
// Create the ND payload
|
||||
var payload [28]byte
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue