At file:///home/jelmer/bzr.samba/SAMBA_4_0/

------------------------------------------------------------
revno: 11993
revision-id: [EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: SAMBA_4_0
timestamp: Mon 2007-04-23 18:22:14 +0200
message:
  Hopefully fix ipv6.
modified:
  source/lib/socket/socket_ipv6.c svn-v2:[EMAIL PROTECTED]
=== modified file 'source/lib/socket/socket_ipv6.c'
--- a/source/lib/socket/socket_ipv6.c   2006-09-10 10:00:42 +0000
+++ b/source/lib/socket/socket_ipv6.c   2007-04-23 16:22:14 +0000
@@ -166,9 +166,11 @@
                return map_nt_error_from_unix(errno);
        }
 
-       ret = listen(sock->fd, queue_size);
-       if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+       if (sock->type == SOCKET_TYPE_STREAM) {
+               ret = listen(sock->fd, queue_size);
+               if (ret == -1) {
+                       return map_nt_error_from_unix(errno);
+               }
        }
 
        if (!(flags & SOCKET_FLAG_BLOCK)) {
@@ -390,6 +392,16 @@
        return sock->fd;
 }
 
+static NTSTATUS ipv6_pending(struct socket_context *sock, size_t *npending)
+{
+       int value = 0;
+       if (ioctl(sock->fd, FIONREAD, &value) == 0) {
+               *npending = value;
+               return NT_STATUS_OK;
+       }
+       return map_nt_error_from_unix(errno);
+}
+
 static const struct socket_ops ipv6_tcp_ops = {
        .name                   = "ipv6",
        .fn_init                = ipv6_tcp_init,
@@ -400,6 +412,7 @@
        .fn_recv                = ipv6_tcp_recv,
        .fn_send                = ipv6_tcp_send,
        .fn_close               = ipv6_tcp_close,
+       .fn_pending             = ipv6_pending,
 
        .fn_set_option          = ipv6_tcp_set_option,
 

Reply via email to