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 | |
parent | 3a940ca2a75e83e0d9495b3bfe79d40558be6476 (diff) |
allo the "bgpctl show neighbor " commands to take the neighbor descr
too, claudio ok
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpctl/parser.c | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/control.c | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 5ddcb10404a..da5f6608253 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.71 2004/12/23 17:26:51 henning Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.72 2004/12/23 17:55:59 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -151,9 +151,9 @@ main(int argc, char *argv[]) break; case SHOW_NEIGHBOR: case SHOW_NEIGHBOR_TIMERS: - if (res->addr.af) + if (res->addr.af || res->peerdesc[0]) imsg_compose(ibuf, IMSG_CTL_SHOW_NEIGHBOR, 0, 0, -1, - &res->addr, sizeof(res->addr)); + &neighbor, sizeof(neighbor)); else imsg_compose(ibuf, IMSG_CTL_SHOW_NEIGHBOR, 0, 0, -1, NULL, 0); diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 2252f73da7e..3b47eb99b79 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.11 2004/12/23 17:45:47 henning Exp $ */ +/* $OpenBSD: parser.c,v 1.12 2004/12/23 17:55:59 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -104,6 +104,7 @@ static const struct token t_show_rib[] = { static const struct token t_show_neighbor[] = { { NOTOKEN, "", NONE, NULL}, { ADDRESS, "", NONE, t_show_neighbor_modifiers}, + { PEERDESC, "", NONE, t_show_neighbor_modifiers}, { ENDTOKEN, "", NONE, NULL} }; 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, |