From: Donatas Abraitis Date: Mon, 12 Jun 2023 12:15:42 +0000 (+0300) Subject: bgpd: Handle peer-group also when showing advertised routes X-Git-Tag: base_9.1~348^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c4d4682ae1a64f0499996f73d972de0e1f2b878d;p=matthieu%2Ffrr.git bgpd: Handle peer-group also when showing advertised routes When trying to list advertised-routes for instance, it's not possible for now. Relax this a bit, and allow doing this, instead of returning an error: % Malformed address or name. Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index ba2985d304..ccbd249422 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -8305,6 +8305,7 @@ struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp, int ret; struct peer *peer; union sockunion su; + struct peer_group *group; /* Get peer sockunion. */ ret = str2sockunion(ip_str, &su); @@ -8313,6 +8314,11 @@ struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp, if (!peer) { peer = peer_lookup_by_hostname(bgp, ip_str); + if (!peer) { + group = peer_group_lookup(bgp, ip_str); + peer = listnode_head(group->peer); + } + if (!peer) { if (use_json) { json_object *json_no = NULL;