close connection when failing to decrypt packets

Since we may never recover from that if nonces got out of sync.

Closes #274.
This commit is contained in:
Matthias Radestock committed 2014-12-28 19:52:56 +00:00
1 parent f792bf7ef8
commit 7cfb79cfc1
3 files changed
+8 -3

No files matched your search

+5 -1
View File
@@ -209,7 +209,11 @@ func (router *Router) udpReader(conn *net.UDPConn, po PacketSink) {
}
err = relayConn.Decryptor.IterateFrames(handleUDPPacket, udpPacket)
if pde, ok := err.(PacketDecodingError); ok {
relayConn.log(pde.Error())
if pde.Fatal {
relayConn.CheckFatal(pde)
} else {
relayConn.log(pde.Error())
}
} else {
checkWarn(err)
}