diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-02-17 13:53:02 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-02-17 14:46:39 +0100 |
commit | d07cd37b993d3c9beded20323174633b806196b5 (patch) | |
tree | 8ae2359a04a821221ee28456328353b33f2060c2 | |
parent | 1ffcb991a900b78c9175f6b093839fe96b1bd7d9 (diff) | |
download | samba-d07cd37b993d3c9beded20323174633b806196b5.tar.gz samba-d07cd37b993d3c9beded20323174633b806196b5.tar.bz2 samba-d07cd37b993d3c9beded20323174633b806196b5.zip |
tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD
metze
-rw-r--r-- | lib/tsocket/tsocket_bsd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c index 13680ec0c5..9027bc9711 100644 --- a/lib/tsocket/tsocket_bsd.c +++ b/lib/tsocket/tsocket_bsd.c @@ -883,10 +883,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); } |