diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2015-10-24 15:15:56 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2015-10-24 15:15:56 +0000 |
commit | 87d829a8534a90dd3f820516b6564aeddcb894aa (patch) | |
tree | f2d6c99afee7c446485d69bd6be821e97a7091b1 /usr.sbin | |
parent | 732283ff3987f5342efe2d1cc3536ae5ff380fbb (diff) |
"bgpctl sh rib in" and "bgpctl sh rib out" require a neighbor argument
to work. send an error if none is given.
ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/control.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c index 34b4a358ff9..b46c5a3f50d 100644 --- a/usr.sbin/bgpd/control.c +++ b/usr.sbin/bgpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.78 2015/10/17 13:07:07 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.79 2015/10/24 15:15:55 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -427,11 +427,21 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt) } ribreq->peerid = p->conf.id; } + if ((ribreq->flags & + (F_CTL_ADJ_OUT | F_CTL_ADJ_IN)) && !p) { + /* + * both in and out tables are only + * meaningful if used on a single + * peer. + */ + control_result(c, CTL_RES_NOSUCHPEER); + break; + } if ((ribreq->flags & F_CTL_ADJ_IN) && p && !p->conf.softreconfig_in) { /* - * if no neighbor was specified we - * try our best. + * without softreconfig_in we do not + * have an Adj-RIB-In table */ control_result(c, CTL_RES_NOCAP); break; |