summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2005-12-24 14:11:13 +0000
committerclaudio <claudio@openbsd.org>2005-12-24 14:11:13 +0000
commit97f91faff86e4069f158c7787ab13058eb5a38d3 (patch)
treef75855365419e94174a13b2ce534ef12d96f8fa6
parentDon't use bzero(&pfd, sizeof(pfd)); pfd is an array so bzero(pfd, sizeof(pfd)); (diff)
downloadwireguard-openbsd-97f91faff86e4069f158c7787ab13058eb5a38d3.tar.xz
wireguard-openbsd-97f91faff86e4069f158c7787ab13058eb5a38d3.zip
bzero the pfd array before setting it up and calling poll because on error
(e.g. EINTR) poll() will not update the pfd array (copyout) and so the old revents are used and results in a blocking parent process. OK dlg@
-rw-r--r--usr.sbin/bgpd/bgpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 5de219abe01..8f9de80e839 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.126 2005/11/02 15:03:02 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.127 2005/12/24 14:11:13 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -252,6 +252,7 @@ main(int argc, char *argv[])
mrt_reconfigure(&mrt_l);
while (quit == 0) {
+ bzero(pfd, sizeof(pfd));
pfd[PFD_PIPE_SESSION].fd = ibuf_se->fd;
pfd[PFD_PIPE_SESSION].events = POLLIN;
if (ibuf_se->w.queued)