mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
INSIST that accept() returns a socket of the correct protocol family. Also
assign the "pf" field in the new socket.
This commit is contained in:
parent
6a3b882115
commit
e90441d922
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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 <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -1654,7 +1654,9 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
|
|||||||
addrlen = sizeof dev->newsocket->address.type;
|
addrlen = sizeof dev->newsocket->address.type;
|
||||||
fd = accept(sock->fd, &dev->newsocket->address.type.sa,
|
fd = accept(sock->fd, &dev->newsocket->address.type.sa,
|
||||||
(void *)&addrlen);
|
(void *)&addrlen);
|
||||||
|
INSIST(sock->pf == dev->newsocket->address.type.sa.sa_family);
|
||||||
dev->newsocket->address.length = addrlen;
|
dev->newsocket->address.length = addrlen;
|
||||||
|
dev->newsocket->pf = sock->pf;
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (SOFT_ERROR(errno)) {
|
if (SOFT_ERROR(errno)) {
|
||||||
select_poke(sock->manager, sock->fd);
|
select_poke(sock->manager, sock->fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user