The branch, v3-5-test has been updated
       via  d68c7db... tsocket/bsd: fix comment in tdgram_bsd_recvfrom_handler()
       via  ba85fac... Fix commit d07cd37b993d3c9beded20323174633b806196b5
       via  b9e7200... tsocket/bsd: fix bug #7115 FreeBSD includes the UDP 
header in FIONREAD
      from  d1dfa2e... tsocket/bsd: set IPV6_V6ONLY on AF_INET6 sockets

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit d68c7db67dc8f87be8a924d1b2b66379fc52b723
Author: Stefan Metzmacher <[email protected]>
Date:   Wed Feb 17 19:11:11 2010 +0100

    tsocket/bsd: fix comment in tdgram_bsd_recvfrom_handler()
    
    metze
    (cherry picked from commit c42d9c4ec410e205091784cd97cbceb5572609d8)

commit ba85facc2ce212d52140086f876eb4915b40bf22
Author: Jeremy Allison <[email protected]>
Date:   Wed Feb 17 09:24:34 2010 -0800

    Fix commit d07cd37b993d3c9beded20323174633b806196b5
    
    Which was:
    
        tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD
    
    Metze, this has to have been wrong - you are throwing away the 
talloc_realloc
    pointer returned. Also no error checking. Please review.
    
    Thank goodness for gcc warnings :-).
    
    Jeremy.
    (cherry picked from commit 936828de71023d90aaec6c1dba84052246bbad11)
    
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit b9e7200f933480bce20219f0294364288be3a5df
Author: Stefan Metzmacher <[email protected]>
Date:   Wed Feb 17 13:53:02 2010 +0100

    tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD
    
    metze
    (cherry picked from commit d07cd37b993d3c9beded20323174633b806196b5)

-----------------------------------------------------------------------

Summary of changes:
 lib/tsocket/tsocket_bsd.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index 634deb8..201788e 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -877,10 +877,17 @@ static void tdgram_bsd_recvfrom_handler(void 
*private_data)
                return;
        }
 
-       if (ret != state->len) {
-               tevent_req_error(req, EIO);
+       /*
+        * Some systems (FreeBSD, see bug #7115) return too much
+        * bytes in tsocket_bsd_pending()/ioctl(fd, FIONREAD, ...),
+        * the return value includes some IP/UDP header bytes,
+        * while recvfrom() just returns the payload.
+        */
+       state->buf = talloc_realloc(state, state->buf, uint8_t, ret);
+       if (tevent_req_nomem(state->buf, req)) {
                return;
        }
+       state->len = ret;
 
        tevent_req_done(req);
 }


-- 
Samba Shared Repository

Reply via email to