Skip to content

bgpd: fix to show exist/non-exist-map in 'show run' properly #18853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -18348,12 +18348,23 @@ static bool peergroup_filter_check(struct peer *peer, afi_t afi, safi_t safi,
uint8_t type, int direct)
{
struct bgp_filter *filter;
filter = &peer->filter[afi][safi];

if (peer_group_active(peer))
if (peer_group_active(peer)) {
/* This is required because the filter_override stores only the filter type.
* To determine whether exist-map or non-exist-map is configured along with adv-map filter,
* 'advmap.condition == direct' is evaluated where 'direct' should be passed appropriately by the caller */
if (type == PEER_FT_ADVERTISE_MAP) {
if (CHECK_FLAG(peer->filter_override[afi][safi][RMAP_OUT], type)) {
/* Only return true if the condition matches what we're checking for */
return (filter->advmap.condition == direct);
}
return false;
}
return !!CHECK_FLAG(peer->filter_override[afi][safi][direct],
type);
}

filter = &peer->filter[afi][safi];
switch (type) {
case PEER_FT_DISTRIBUTE_LIST:
return !!(filter->dlist[direct].name);
Expand Down
Loading