Commit 36c93a9f authored by Bernd Lietzow's avatar Bernd Lietzow

client: don't kill DGramLis when receiving 0 byte datagram

An empty UDP datagram is indeed valid, it just contains no valuable
information. Before this commit, it caused the DatagramListener of the
client to die when it was received. Now, there is just a log message.
Deserialization is not attempted because there is no data in it.
parent 9aed3394
......@@ -47,11 +47,19 @@ void __DatagramListener_listenLoop(DatagramListener* this)
continue;
}
else
if(unlikely(recvRes <= 0) )
{ // error
if(recvRes == 0)
{
char* fromIP = SocketTk_ipaddrToStr(&fromAddr.addr);
Logger_logFormatted(log, Log_NOTICE, logContext,
"Received an empty datagram. IP: %s; port: %d",
fromIP, fromAddr.port);
kfree(fromIP);
//if(errno == -EINTR) // ignore iterruption, because the debugger makes this happen
// continue;
continue;
}
else
if(unlikely(recvRes < 0) )
{ // error
Logger_logErrFormatted(log, logContext,
"Encountered an unrecoverable socket error. ErrCode: %d", recvRes);
......
name: "Empty UDP packet"
desc: "Check that server processes do not shut down when they receive a 0 byte UDP datagram."
xfail_msg: not yet fixed
hosts:
node:
- mgmtd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment