svn commit: samba r22488 - in branches/SAMBA_4_0: . source/lib/socket

jelmer at samba.org jelmer at samba.org
Mon Apr 23 15:32:48 GMT 2007


Author: jelmer
Date: 2007-04-23 15:32:47 +0000 (Mon, 23 Apr 2007)
New Revision: 22488

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22488

Log:
Hopefully fix ipv6.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
...skipped...

Modified: branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c
===================================================================
--- branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c	2007-04-23 13:37:33 UTC (rev 22487)
+++ branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c	2007-04-23 15:32:47 UTC (rev 22488)
@@ -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,
 



More information about the samba-cvs mailing list