From cb7a5f17d9b5b5c47bb454b0474ef07ea98bdae1 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 6 Nov 2018 19:23:20 +0000 Subject: [PATCH] Check destination address upon receive in router --- src/yggdrasil/router.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/yggdrasil/router.go b/src/yggdrasil/router.go index 09058e43..8b5d17e4 100644 --- a/src/yggdrasil/router.go +++ b/src/yggdrasil/router.go @@ -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