From e90441d922146d463e03109f7130a577874db86c Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 23 Jan 2001 20:42:46 +0000 Subject: [PATCH] INSIST that accept() returns a socket of the correct protocol family. Also assign the "pf" field in the new socket. --- lib/isc/unix/socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 2f93bedbd4..18dbff4d38 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.180 2001/01/11 18:57:23 gson Exp $ */ +/* $Id: socket.c,v 1.181 2001/01/23 20:42:46 bwelling Exp $ */ #include @@ -1654,7 +1654,9 @@ internal_accept(isc_task_t *me, isc_event_t *ev) { addrlen = sizeof dev->newsocket->address.type; fd = accept(sock->fd, &dev->newsocket->address.type.sa, (void *)&addrlen); + INSIST(sock->pf == dev->newsocket->address.type.sa.sa_family); dev->newsocket->address.length = addrlen; + dev->newsocket->pf = sock->pf; if (fd < 0) { if (SOFT_ERROR(errno)) { select_poke(sock->manager, sock->fd);