don't trip over truncated udp packets

and log such events, plus any other errors during decoding, nicely,
including the connection on which this occured.

Closes #123.
This commit is contained in:
Matthias Radestock committed 2014-10-15 21:03:15 +01:00
1 parent e8ec9e84ce
commit 4ddfc47448
4 files changed
+24 -4

No files matched your search

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