5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-09-19 16:09:36 +00:00

don't return an error if the source address is wrong, since this happens very frequently for link-local traffic

This commit is contained in:
Arceliar 2021-06-13 09:51:53 -05:00
parent c6a7a077a3
commit 2726dc0076

View File

@ -289,7 +289,9 @@ func (k *keyStore) writePC(bs []byte) (int, error) {
copy(srcSubnet[:], bs[8:])
copy(dstSubnet[:], bs[24:])
if srcAddr != k.address && srcSubnet != k.subnet {
return 0, errors.New("wrong source address")
// This happens all the time due to link-local traffic
// Don't send back an error, just drop it
return 0, nil
}
buf := make([]byte, 1+len(bs), 65535)
buf[0] = typeSessionTraffic