summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/control.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2008-05-08 04:05:38 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2008-05-08 04:05:38 +0000
commit0fc048ad7913b9199d07a3be80c65cdfca4e7c29 (patch)
treea489959fa29f513f12b18ac1dc174baeb484d9ff /usr.sbin/bgpd/control.c
parenta3c7cc0a69f213094a201360d7184814a9bcee99 (diff)
make sure we always send back something on IMSG_CTL_SHOW_NEIGHBOR
namely, the "no such neighbor" case was missing. problem spotted by martin,ok claudio
Diffstat (limited to 'usr.sbin/bgpd/control.c')
-rw-r--r--usr.sbin/bgpd/control.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 522564e175e..9dbbe18ecb7 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.58 2008/01/31 12:17:35 henning Exp $ */
+/* $OpenBSD: control.c,v 1.59 2008/05/08 04:05:37 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -257,14 +257,17 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt)
p = getpeerbyaddr(&neighbor->addr);
if (p == NULL)
p = getpeerbydesc(neighbor->descr);
- if (p != NULL && !neighbor->show_timers) {
+ if (p == NULL) {
+ control_result(c, CTL_RES_NOSUCHPEER);
+ break;
+ }
+ if (!neighbor->show_timers) {
imsg_compose_rde(imsg.hdr.type,
imsg.hdr.pid,
p, sizeof(struct peer));
imsg_compose_rde(IMSG_CTL_END,
imsg.hdr.pid, NULL, 0);
- }
- if (p != NULL && neighbor->show_timers) {
+ } else {
u_int i;
time_t d;
struct ctl_timer ct;