4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-06-14 22:06:05 +00:00

Check destination address upon receive in router

This commit is contained in:
Neil Alexander
2018-11-06 19:23:20 +00:00
parent 2f75075da3
commit cb7a5f17d9

View File

@ -259,6 +259,12 @@ func (r *router) recvPacket(bs []byte, sinfo *sessionInfo) {
util_putBytes(bs)
return
}
var dest address
copy(dest[:], bs[24:])
if !r.cryptokey.isValidSource(dest) {
util_putBytes(bs)
return
}
var source address
copy(source[:], bs[8:])
var snet subnet