Skip to content

Commit e7ac7da

Browse files
authored
Merge pull request #18853 from opensourcerouting/fix/backport_aa012d8d43c2cf703dcfd57927a47da059bf16b3
bgpd: fix to show exist/non-exist-map in 'show run' properly
2 parents 5d50c19 + 214db8e commit e7ac7da

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

bgpd/bgp_vty.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18353,12 +18353,23 @@ static bool peergroup_filter_check(struct peer *peer, afi_t afi, safi_t safi,
1835318353
uint8_t type, int direct)
1835418354
{
1835518355
struct bgp_filter *filter;
18356+
filter = &peer->filter[afi][safi];
1835618357

18357-
if (peer_group_active(peer))
18358+
if (peer_group_active(peer)) {
18359+
/* This is required because the filter_override stores only the filter type.
18360+
* To determine whether exist-map or non-exist-map is configured along with adv-map filter,
18361+
* 'advmap.condition == direct' is evaluated where 'direct' should be passed appropriately by the caller */
18362+
if (type == PEER_FT_ADVERTISE_MAP) {
18363+
if (CHECK_FLAG(peer->filter_override[afi][safi][RMAP_OUT], type)) {
18364+
/* Only return true if the condition matches what we're checking for */
18365+
return (filter->advmap.condition == direct);
18366+
}
18367+
return false;
18368+
}
1835818369
return !!CHECK_FLAG(peer->filter_override[afi][safi][direct],
1835918370
type);
18371+
}
1836018372

18361-
filter = &peer->filter[afi][safi];
1836218373
switch (type) {
1836318374
case PEER_FT_DISTRIBUTE_LIST:
1836418375
return !!(filter->dlist[direct].name);

0 commit comments

Comments
 (0)