CVS commit: src/external/mpl/bind/dist/lib/isc/unix/include/isc

2021-03-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 23 20:57:10 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix/include/isc: align.h

Log Message:
We have _Alignas now


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h
diff -u src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h:1.3 src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h:1.4
--- src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h:1.3	Fri Feb 19 11:42:20 2021
+++ src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h	Tue Mar 23 16:57:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: align.h,v 1.3 2021/02/19 16:42:20 christos Exp $	*/
+/*	$NetBSD: align.h,v 1.4 2021/03/23 20:57:10 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -18,8 +18,3 @@
 #else /* ifdef HAVE_STDALIGN_H */
 #define alignas(x) __attribute__((__aligned__(x)))
 #endif /* ifdef HAVE_STDALIGN_H */
-#ifdef __lint__
-// XXX: bug
-#undef alignas
-#define alignas(a)
-#endif



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2021-02-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 22 01:31:52 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Locking protocol changed again, adjust.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.19 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.20
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.19	Fri Feb 19 11:42:20 2021
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Sun Feb 21 20:31:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.19 2021/02/19 16:42:20 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.20 2021/02/22 01:31:51 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -3214,8 +3214,6 @@ internal_fdwatch_write(isc__socket_t *so
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_WRITE);
-
-	UNLOCK(>lock);
 }
 
 static void
@@ -3242,8 +3240,6 @@ internal_fdwatch_read(isc__socket_t *soc
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_READ);
-
-	UNLOCK(>lock);
 }
 
 /*



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2020-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 29 16:07:11 UTC 2020

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Locking protocol changed again, unlock after send/recv


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.17 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.18
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.17	Mon Aug  3 13:23:43 2020
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Sat Aug 29 12:07:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.17 2020/08/03 17:23:43 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.18 2020/08/29 16:07:11 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -3201,6 +3201,8 @@ internal_fdwatch_write(isc__socket_t *so
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_WRITE);
+
+	UNLOCK(>lock);
 }
 
 static void
@@ -3227,6 +3229,8 @@ internal_fdwatch_read(isc__socket_t *soc
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_READ);
+
+	UNLOCK(>lock);
 }
 
 /*



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2020-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun  1 18:55:37 UTC 2020

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Locking protocol changed; the internal routines are now called with the
socket locked. Adjust for that.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.15 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.16
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.15	Sun May 31 13:45:02 2020
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Mon Jun  1 14:55:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.15 2020/05/31 17:45:02 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.16 2020/06/01 18:55:37 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -3174,7 +3174,6 @@ internal_fdwatch_write(isc__socket_t *so
 
 	INSIST(VALID_SOCKET(sock));
 
-	LOCK(>lock);
 	isc_refcount_increment(>references);
 	UNLOCK(>lock);
 
@@ -3192,8 +3191,6 @@ internal_fdwatch_write(isc__socket_t *so
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_WRITE);
-
-	UNLOCK(>lock);
 }
 
 static void
@@ -3203,7 +3200,6 @@ internal_fdwatch_read(isc__socket_t *soc
 
 	INSIST(VALID_SOCKET(sock));
 
-	LOCK(>lock);
 	isc_refcount_increment(>references);
 	UNLOCK(>lock);
 
@@ -3221,8 +3217,6 @@ internal_fdwatch_read(isc__socket_t *soc
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_READ);
-
-	UNLOCK(>lock);
 }
 
 /*



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2020-05-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 31 17:45:02 UTC 2020

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
sync with regular socket code (no effect)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.14 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.15
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.14	Sun May 24 15:46:27 2020
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Sun May 31 13:45:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.14 2020/05/24 19:46:27 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.15 2020/05/31 17:45:02 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -5739,13 +5739,17 @@ isc_socket_fdwatchcreate(isc_socketmgr_t
 #if defined(USE_EPOLL)
 	manager->epoll_events[sock->fd] = 0;
 #endif
+#ifdef USE_DEVPOLL
+	INSIST(thread->fdpollinfo[sock->fd].want_read == 0 &&
+	   thread->fdpollinfo[sock->fd].want_write == 0);
+#endif /* ifdef USE_DEVPOLL */
 	UNLOCK(>fdlock[lockid]);
 
 	LOCK(>lock);
 	ISC_LIST_APPEND(manager->socklist, sock, link);
 #ifdef USE_SELECT
-	if (manager->maxfd < sock->fd)
-		manager->maxfd = sock->fd;
+	if (thread->maxfd < sock->fd)
+		thread->maxfd = sock->fd;
 #endif
 	UNLOCK(>lock);
 



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2019-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 29 01:38:27 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: app.c

Log Message:
Only ignore signals if we are bind (not dhcpd).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/lib/isc/unix/app.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/app.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/app.c:1.4 src/external/mpl/bind/dist/lib/isc/unix/app.c:1.5
--- src/external/mpl/bind/dist/lib/isc/unix/app.c:1.4	Sun Feb 24 15:01:31 2019
+++ src/external/mpl/bind/dist/lib/isc/unix/app.c	Sat Dec 28 20:38:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: app.c,v 1.4 2019/02/24 20:01:31 christos Exp $	*/
+/*	$NetBSD: app.c,v 1.5 2019/12/29 01:38:27 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -196,6 +196,7 @@ isc_app_ctxstart(isc_appctx_t *ctx0) {
 		goto cleanup;
 #endif
 
+	if (isc_bind9) {
 	/*
 	 * Block SIGHUP, SIGINT, SIGTERM.
 	 *
@@ -224,6 +225,7 @@ isc_app_ctxstart(isc_appctx_t *ctx0) {
 		result = ISC_R_UNEXPECTED;
 		goto cleanup;
 	}
+	}
 
 	return (ISC_R_SUCCESS);
 



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2019-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 18:03:40 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
shorten name, use snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.8 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.9
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.8	Sun Feb 24 15:01:32 2019
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Sun Mar 10 14:03:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.8 2019/02/24 20:01:32 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.9 2019/03/10 18:03:40 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -3956,8 +3956,8 @@ isc_socketmgr_create2(isc_mem_t *mctx, i
 		>threads[i],
 		>threads[i].thread)
 			  == ISC_R_SUCCESS);
-		char tname[1024];
-		sprintf(tname, "isc-socket-%d", i);
+		char tname[128];
+		snprintf(tname, sizeof(tname), "sock-%d", i);
 		isc_thread_setname(manager->threads[i].thread, tname);
 	}
 



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2019-02-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 13 01:16:30 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
cleanup unused stuff now that we execute directly and not in a separate task.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.6 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.7
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.6	Mon Feb 11 21:38:55 2019
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Tue Feb 12 20:16:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.6 2019/02/12 02:38:55 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.7 2019/02/13 01:16:30 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -351,14 +351,6 @@ struct isc__socket {
 	charname[16];
 	void *tag;
 
-	/*
-	 * Internal events.  Posted when a descriptor is readable or
-	 * writable.  These are statically allocated and never freed.
-	 * They will be set to non-purgable before use.
-	 */
-	intev_t			readable_ev;
-	intev_t			writable_ev;
-
 	ISC_LIST(isc_socketevent_t)		send_list;
 	ISC_LIST(isc_socketevent_t)		recv_list;
 	ISC_LIST(isc_socket_newconnev_t)	accept_list;
@@ -366,9 +358,7 @@ struct isc__socket {
 
 	isc_sockaddr_t		peer_address;   /* remote address */
 
-	unsigned int		pending_recv : 1,
-pending_send : 1,
-listener : 1,   /* listener socket */
+	unsigned int		listener : 1,   /* listener socket */
 connected : 1,
 connecting : 1, /* connect pending */
 bound : 1,  /* bound to local addr */
@@ -380,10 +370,10 @@ struct isc__socket {
 	unsigned char		overflow; /* used for MSG_TRUNC fake */
 #endif
 
-void*fdwatcharg;
-isc_sockfdwatch_t   fdwatchcb;
-int fdwatchflags;
-isc_task_t  *fdwatchtask;
+	void			*fdwatcharg;
+	isc_sockfdwatch_t	fdwatchcb;
+	int			fdwatchflags;
+	isc_task_t  *fdwatchtask;
 	unsigned int		dscp;
 };
 
@@ -474,8 +464,8 @@ static void internal_accept(isc__socket_
 static void internal_connect(isc__socket_t *);
 static void internal_recv(isc__socket_t *);
 static void internal_send(isc__socket_t *);
-static void internal_fdwatch_write(isc_task_t *, isc_event_t *);
-static void internal_fdwatch_read(isc_task_t *, isc_event_t *);
+static void internal_fdwatch_write(isc__socket_t *);
+static void internal_fdwatch_read(isc__socket_t *);
 static void process_cmsg(isc__socket_t *, struct msghdr *, isc_socketevent_t *);
 static void build_msghdr_send(isc__socket_t *, char *, isc_socketevent_t *,
 			  struct msghdr *, struct iovec *, size_t *);
@@ -1962,8 +1952,6 @@ allocate_socket(isc__socketmgr_t *manage
 	ISC_LIST_INIT(sock->accept_list);
 	ISC_LIST_INIT(sock->connect_list);
 	sock->listener = 0;
-	sock->pending_recv = 0;
-	sock->pending_send = 0;
 	sock->connected = 0;
 	sock->connecting = 0;
 	sock->bound = 0;
@@ -1974,16 +1962,6 @@ allocate_socket(isc__socketmgr_t *manage
 	 */
 	isc_mutex_init(>lock);
 
-	/*
-	 * Initialize readable and writable events.
-	 */
-	ISC_EVENT_INIT(>readable_ev, sizeof(intev_t),
-		   ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTR,
-		   NULL, sock, sock, NULL, NULL);
-	ISC_EVENT_INIT(>writable_ev, sizeof(intev_t),
-		   ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTW,
-		   NULL, sock, sock, NULL, NULL);
-
 	sock->common.magic = ISCAPI_SOCKET_MAGIC;
 	sock->common.impmagic = SOCKET_MAGIC;
 	*socketp = sock;
@@ -2005,8 +1983,6 @@ free_socket(isc__socket_t **socketp) {
 	INSIST(VALID_SOCKET(sock));
 	INSIST(isc_refcount_current(>references) == 0);
 	INSIST(!sock->connecting);
-	INSIST(!sock->pending_recv);
-	INSIST(!sock->pending_send);
 	INSIST(ISC_LIST_EMPTY(sock->recv_list));
 	INSIST(ISC_LIST_EMPTY(sock->send_list));
 	INSIST(ISC_LIST_EMPTY(sock->accept_list));
@@ -2820,8 +2796,6 @@ isc_socket_close(isc_socket_t *sock0) {
 	REQUIRE(sock->fd >= 0 && sock->fd < (int)sock->manager->maxsocks);
 
 	INSIST(!sock->connecting);
-	INSIST(!sock->pending_recv);
-	INSIST(!sock->pending_send);
 	INSIST(ISC_LIST_EMPTY(sock->recv_list));
 	INSIST(ISC_LIST_EMPTY(sock->send_list));
 	INSIST(ISC_LIST_EMPTY(sock->accept_list));
@@ -2849,64 +2823,22 @@ isc_socket_close(isc_socket_t *sock0) {
 	return (ISC_R_SUCCESS);
 }
 
-/*
- * I/O is possible on a given socket.  Schedule an event to this task that
- * will call an internal function to do the I/O.  This will charge the
- * task with the I/O operation and let our select loop handler get back
- * to doing something real as fast as possible.
- *
- * The socket and manager must be locked before calling this function.
- */
 static void
 

CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2019-02-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 12 02:38:56 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Instead of queuing to a separate task, handle the fdwatch events inline.
Fixes locking. We could simplify the code a lot more now.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.5 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.6
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.5	Sat Jan 26 20:51:00 2019
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Mon Feb 11 21:38:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.5 2019/01/27 01:51:00 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.6 2019/02/12 02:38:55 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -2866,24 +2866,20 @@ dispatch_recv(isc__socket_t *sock) {
 		internal_recv(sock);
 		return;
 	}
-#if 0
+
+	LOCK(>lock);
 	INSIST(!sock->pending_recv);
-#else
-	// XXX: locking
-	if (sock->pending_recv)
-		return;
-#endif
 
 	sender = sock->fdwatchtask;
 	sock->pending_recv = 1;
 	iev = >readable_ev;
 
-	sock->references++;
+	isc_refcount_increment(>references);
 	iev->ev_sender = sock;
 	iev->ev_action = internal_fdwatch_read;
 	iev->ev_arg = sock;
-
-	isc_task_send(sender, (isc_event_t **));
+	UNLOCK(>lock);
+	internal_fdwatch_read(sender, iev);
 }
 
 static void
@@ -2896,18 +2892,21 @@ dispatch_send(isc__socket_t *sock) {
 		return;
 	}
 
+	LOCK(>lock);
+
 	INSIST(!sock->pending_send);
 
 	sender = sock->fdwatchtask;
 	sock->pending_send = 1;
 	iev = >writable_ev;
 
-	sock->references++;
+	isc_refcount_increment(>references);
 	iev->ev_sender = sock;
 	iev->ev_action = internal_fdwatch_write;
 	iev->ev_arg = sock;
 
-	isc_task_send(sender, (isc_event_t **));
+	UNLOCK(>lock);
+	internal_fdwatch_write(sender, iev);
 }
 
 /*
@@ -3374,9 +3373,7 @@ internal_fdwatch_write(isc_task_t *me, i
 
 	sock->pending_send = 0;
 
-	INSIST(sock->references > 0);
-	sock->references--;  /* the internal event is done with this socket */
-	if (sock->references == 0) {
+	if (isc_refcount_decrement(>references) == 0) {
 		UNLOCK(>lock);
 		destroy();
 		return;
@@ -3408,16 +3405,14 @@ internal_fdwatch_read(isc_task_t *me, is
 		   "internal_fdwatch_read: task %p got event %p", me, ev);
 
 	INSIST(sock->pending_recv == 1);
-	sock->pending_recv = 0;
 
 	UNLOCK(>lock);
 	more_data = (sock->fdwatchcb)(me, (isc_socket_t *)sock,
   sock->fdwatcharg, ISC_SOCKFDWATCH_READ);
 	LOCK(>lock);
 
-	INSIST(sock->references > 0);
-	sock->references--;  /* the internal event is done with this socket */
-	if (sock->references == 0) {
+	sock->pending_recv = 0;
+	if (isc_refcount_decrement(>references) == 0) {
 		UNLOCK(>lock);
 		destroy();
 		return;



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2018-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 13 08:48:46 UTC 2018

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Make ENOBUFS a soft error


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/bind/dist/lib/isc/unix/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.2 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.3
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.2	Sun Aug 12 09:02:39 2018
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Mon Aug 13 04:48:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.2 2018/08/12 13:02:39 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.3 2018/08/13 08:48:46 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -258,6 +258,7 @@ typedef enum { poll_idle, poll_active, p
 #define SOFT_ERROR(e)	((e) == EAGAIN || \
 			 (e) == EWOULDBLOCK || \
 			 (e) == EINTR || \
+			 (e) == ENOBUFS || \
 			 (e) == 0)
 
 #define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x)
@@ -1953,7 +1954,7 @@ doio_recv(isc__socket_t *sock, isc_socke
 		SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN);
 		/* HPUX 11.11 can return EADDRNOTAVAIL. */
 		SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
-		ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES);
+		SOFT_OR_HARD(ENOBUFS, ISC_R_NORESOURCES);
 		/* Should never get this one but it was seen. */
 #ifdef ENOPROTOOPT
 		SOFT_OR_HARD(ENOPROTOOPT, ISC_R_HOSTUNREACH);
@@ -2150,7 +2151,7 @@ doio_send(isc__socket_t *sock, isc_socke
 		ALWAYS_HARD(EHOSTDOWN, ISC_R_HOSTUNREACH);
 #endif
 		ALWAYS_HARD(ENETUNREACH, ISC_R_NETUNREACH);
-		ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES);
+		SOFT_OR_HARD(ENOBUFS, ISC_R_NORESOURCES);
 		ALWAYS_HARD(EPERM, ISC_R_HOSTUNREACH);
 		ALWAYS_HARD(EPIPE, ISC_R_NOTCONNECTED);
 		ALWAYS_HARD(ECONNRESET, ISC_R_CONNECTIONRESET);