summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2019-10-02 08:58:34 +0000
committerclaudio <claudio@openbsd.org>2019-10-02 08:58:34 +0000
commitbb06c696ef7b4a8ee8c582193f9eb16a68cf9114 (patch)
treeed0e458816f40e6c92fab180ccd5dabc30a32381 /usr.sbin/bgpd
parentWhen removing a peer do the RB_REMOVE last and log the removal just before (diff)
downloadwireguard-openbsd-bb06c696ef7b4a8ee8c582193f9eb16a68cf9114.tar.xz
wireguard-openbsd-bb06c696ef7b4a8ee8c582193f9eb16a68cf9114.zip
In IMSG_PFKEY_RELOAD do not warn about unknown peers. When a peer is
removed the session engine will issue a IMSG_PFKEY_RELOAD call after the parent has removed the peer which is no problem and so no need to fill the log with this. OK benno@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/bgpd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 2ffd8f7900f..e8836230326 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.226 2019/10/01 08:57:47 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.227 2019/10/02 08:58:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -812,13 +812,12 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct bgpd_config *conf)
rv = -1;
break;
case IMSG_PFKEY_RELOAD:
- if (idx != PFD_PIPE_SESSION)
+ if (idx != PFD_PIPE_SESSION) {
log_warnx("pfkey reload request not from SE");
- else if ((p = getpeerbyid(conf, imsg.hdr.peerid)) ==
- NULL)
- log_warnx("pfkey reload: no such peer: id=%u",
- imsg.hdr.peerid);
- else {
+ break;
+ }
+ p = getpeerbyid(conf, imsg.hdr.peerid);
+ if (p != NULL) {
if (pfkey_establish(p) == -1)
log_peer_warnx(&p->conf,
"pfkey setup failed");