summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2006-05-27 19:59:44 +0000
committerhenning <henning@openbsd.org>2006-05-27 19:59:44 +0000
commit74b2e30e2f7b0295d04650269a35d4bea381b348 (patch)
tree9a1aa9d4c85802bfbe7319731927f4a9fa3e23bc
parentsync (diff)
downloadwireguard-openbsd-74b2e30e2f7b0295d04650269a35d4bea381b348.tar.xz
wireguard-openbsd-74b2e30e2f7b0295d04650269a35d4bea381b348.zip
if the pid given to imsg_create is 0, use the pid sored in the ibuf (which
is the current process' pid). fixes blocking with concurrent bgpctl instances... oups. surprised we missed that earlier, the pid stuff was only ever added for that purposed, but we missed to set the pid. gigantic oups. with & ok claudio
-rw-r--r--usr.sbin/bgpd/imsg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c
index a9498d93dd9..698dc11498e 100644
--- a/usr.sbin/bgpd/imsg.c
+++ b/usr.sbin/bgpd/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.37 2005/11/02 15:34:43 claudio Exp $ */
+/* $OpenBSD: imsg.c,v 1.38 2006/05/27 19:59:44 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -158,7 +158,8 @@ imsg_create(struct imsgbuf *ibuf, enum imsg_type type, u_int32_t peerid,
hdr.len = datalen + IMSG_HEADER_SIZE;
hdr.type = type;
hdr.peerid = peerid;
- hdr.pid = pid;
+ if ((hdr.pid = pid) == 0)
+ hdr.pid = ibuf->pid;
if ((wbuf = buf_open(hdr.len)) == NULL) {
log_warn("imsg_create: buf_open");
return (NULL);