diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-12-23 17:56:00 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-12-23 17:56:00 +0000 |
commit | 5dcad9bb508d438c06064fc1fe318e97113cf353 (patch) | |
tree | f7b26aee87136bc06acd81db39e0670c97a12cd7 /usr.sbin/bgpd | |
parent | 3a940ca2a75e83e0d9495b3bfe79d40558be6476 (diff) |
allo the "bgpctl show neighbor " commands to take the neighbor descr
too, claudio ok
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/control.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c index b7c4ed27807..cae0e203533 100644 --- a/usr.sbin/bgpd/control.c +++ b/usr.sbin/bgpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.40 2004/12/23 17:26:51 henning Exp $ */ +/* $OpenBSD: control.c,v 1.41 2004/12/23 17:55:58 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -185,7 +185,6 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt) struct ctl_conn *c; int n; struct peer *p; - struct bgpd_addr *addr; struct ctl_neighbor *neighbor; if ((c = control_connbyfd(pfd->fd)) == NULL) { @@ -220,9 +219,11 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt) case IMSG_CTL_SHOW_NEIGHBOR: c->ibuf.pid = imsg.hdr.pid; if (imsg.hdr.len == IMSG_HEADER_SIZE + - sizeof(struct bgpd_addr)) { - addr = imsg.data; - p = getpeerbyaddr(addr); + sizeof(struct ctl_neighbor)) { + neighbor = imsg.data; + p = getpeerbyaddr(&neighbor->addr); + if (p == NULL) + p = getpeerbydesc(neighbor->descr); if (p != NULL) imsg_compose_rde(imsg.hdr.type, imsg.hdr.pid, |