diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-06-20 18:07:07 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-06-20 18:07:07 +0000 |
commit | 5630d40125879f563d7fa75376fb11c148a011df (patch) | |
tree | 5e588271089beeee9325d44a47a775589ffe3974 /usr.sbin/bgpd | |
parent | 873ad064c822ac7fef1a1fb072d59a9879caff11 (diff) |
allow for receival of up to 16 fds at once; after discussion with theo
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/imsg.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c index 20738c25058..459ffef87dd 100644 --- a/usr.sbin/bgpd/imsg.c +++ b/usr.sbin/bgpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.26 2004/06/20 17:49:46 henning Exp $ */ +/* $OpenBSD: imsg.c,v 1.27 2004/06/20 18:07:06 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -47,7 +47,7 @@ imsg_read(struct imsgbuf *ibuf) { struct msghdr msg; struct cmsghdr *cmsg; - char cmsgbuf[CMSG_SPACE(sizeof(int))]; + char cmsgbuf[CMSG_SPACE(sizeof(int) * 16)]; struct iovec iov; ssize_t n; int fd; @@ -71,7 +71,8 @@ imsg_read(struct imsgbuf *ibuf) ibuf->r.wpos += n; - if ((cmsg = CMSG_FIRSTHDR(&msg)) != NULL) { + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { fd = (*(int *)CMSG_DATA(cmsg)); |