From e3479e2ecce8b4800d2935f3002b550396bd1897 Mon Sep 17 00:00:00 2001 From: Brian Rak Date: Mon, 14 Aug 2017 17:22:03 -0400 Subject: [PATCH] bgpd: Check for per-peer outbound configuration, in addition to the peer-group config When displaying the config, bgpd only checked for the existance of a peer-group prefix-list before deciding to not display the outbound prefix-list. This commit updates the outbound prefix-list logic to match the inbound. --- bgpd/bgpd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 70e55e6d7b..01dbd2902a 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -6142,11 +6142,15 @@ static void bgp_config_write_filter(struct vty *vty, struct peer *peer, VTY_NEWLINE); } - if (filter->plist[out].name && !gfilter) { - afi_header_vty_out(vty, afi, safi, write, - " neighbor %s prefix-list %s out%s", addr, - filter->plist[out].name, VTY_NEWLINE); - } + if (filter->plist[out].name) + if (!gfilter || !gfilter->plist[out].name + || strcmp(filter->plist[out].name, gfilter->plist[out].name) + != 0) { + afi_header_vty_out(vty, afi, safi, write, + " neighbor %s prefix-list %s out%s", + addr, filter->plist[out].name, + VTY_NEWLINE); + } /* route-map. */ if (filter->map[RMAP_IN].name) -- 2.39.5