Skip to content
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

extcommunity-list expanded x delete matches against all extended community values making it impossible to delete only a single extcommunity by regex #17081

Open
2 tasks done
rudis opened this issue Oct 12, 2024 · 1 comment
Assignees
Labels

Comments

@rudis
Copy link
Contributor

rudis commented Oct 12, 2024

Description

I'm trying to delete one type of extended community with any value (e.g. all "RT:x:y", no matter x and y) but not extended communities with other types.

The following config removes all extended community entries, even non RT types.

bgp extcommunity-list expanded exp seq 5 permit RT:
route-map test permit 10
 set extended-comm-list exp delete
exit

Removing a single RT value works (only RT:65002:9001 is removed):

bgp extcommunity-list standard std seq 10 permit rt 65002:9001
route-map test permit 10
 set extended-comm-list std delete
exit

The problem seems to be that ecommunity_list_match_delete passes ecom to ecommunity_regexp_match and not local_ecom. So the full string of the ecommunity is compared in each iteration. Fixing this should be as simple as passing local_ecom, but I didn't test it.

From a quick look it the same issue affects community_list_match_delete and lcommunity_list_match_delete as well. Or is this expected behavior?

Version

10.1.1, also present in current git

How to reproduce

See above

Expected behavior

extcommunity-list expanded matches against a single ecommunity value.

Actual behavior

extcommunity-list expanded matches against the whole ecommunity value.

Additional context

No response

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.
@rudis rudis added the triage Needs further investigation label Oct 12, 2024
@ton31337 ton31337 added the bgp label Oct 13, 2024
@ton31337
Copy link
Member

Well, "RT:" is too simple to be evaluated strictly, so it matches everything that has RT:*. (expected). The idea of how it works is, that we convert all the extended communities into a string (e.g. RT:1.1.1.1:1 RT 2.2.2.2:2), then apply RT: which matches a string.

If you specify something like bgp extcommunity-list expanded r1-rt seq 5 permit RT:1.1.1.1:1$ it won't match because the end ($) is with 2.2.2.2:2.

@ton31337 ton31337 self-assigned this Oct 13, 2024
@ton31337 ton31337 removed the triage Needs further investigation label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants