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:
1 parent
e8ec9e84ce
commit
4ddfc47448
4 files changed
+24
-4
No files matched your search
+6
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user