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(srcSubnet[:], bs[8:])
copy(dstSubnet[:], bs[24:]) copy(dstSubnet[:], bs[24:])
if srcAddr != k.address && srcSubnet != k.subnet { 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 := make([]byte, 1+len(bs), 65535)
buf[0] = typeSessionTraffic buf[0] = typeSessionTraffic