1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

lib/tsocket: fix receiving of udp packets from 0 bytes (bug #9184)

It's possible for a client to send 0 bytes in a UDP packet,
we need still need to call recvfrom() and skip the invalid
packet at a higher level. Otherwise the kernel receive queue
is blocked.

metze
This commit is contained in:
Stefan Metzmacher 2012-09-21 22:54:26 +02:00
parent cc93a3004e
commit eacdd9f730

View File

@ -876,10 +876,6 @@ static void tdgram_bsd_recvfrom_handler(void *private_data)
bool retry;
ret = tsocket_bsd_pending(bsds->fd);
if (ret == 0) {
/* retry later */
return;
}
err = tsocket_bsd_error_from_errno(ret, errno, &retry);
if (retry) {
/* retry later */
@ -889,6 +885,7 @@ static void tdgram_bsd_recvfrom_handler(void *private_data)
return;
}
/* note that 'ret' can be 0 here */
state->buf = talloc_array(state, uint8_t, ret);
if (tevent_req_nomem(state->buf, req)) {
return;