From 30028e3328dc450e71ac9e070ec8b9eea193800a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Feb 2010 13:53:02 +0100 Subject: [PATCH] tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD metze (cherry picked from commit d07cd37b993d3c9beded20323174633b806196b5) (cherry picked from commit b9e7200f933480bce20219f0294364288be3a5df) --- lib/tsocket/tsocket_bsd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c index 634deb8280c..8080d410d3a 100644 --- a/lib/tsocket/tsocket_bsd.c +++ b/lib/tsocket/tsocket_bsd.c @@ -877,10 +877,12 @@ static void tdgram_bsd_recvfrom_handler(void *private_data) return; } - if (ret != state->len) { - tevent_req_error(req, EIO); - return; - } + /* + * some systems too much bytes in tsocket_bsd_pending() + * the return value includes some IP/UDP header bytes + */ + state->len = ret; + talloc_realloc(state, state->buf, uint8_t, ret); tevent_req_done(req); } -- 2.11.4.GIT