Skip to content

Commit

Permalink
Merge pull request #17305 from opensourcerouting/fix/bgp_community_li…
Browse files Browse the repository at this point in the history
…st_numbered

bgpd: Treat numbered community-list only if it's in a range 1-500
  • Loading branch information
riw777 authored Nov 5, 2024
2 parents f68d5b3 + 4c1ee29 commit 318e983
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_clist.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ community_list_insert(struct community_list_handler *ch, const char *name,
}

/* In case of name is all digit character */
if (i == strlen(name)) {
if (i == strlen(name) && number <= COMMUNITY_LIST_NUMBER_MAX) {
new->sort = COMMUNITY_LIST_NUMBER;

/* Set access_list to number list. */
Expand Down
4 changes: 4 additions & 0 deletions bgpd/bgp_clist.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
/* Number and string based community-list name. */
#define COMMUNITY_LIST_STRING 0
#define COMMUNITY_LIST_NUMBER 1
/* The numbered community-list (including large/ext communities)
* have a range between 1-500.
*/
#define COMMUNITY_LIST_NUMBER_MAX 500

#define COMMUNITY_SEQ_NUMBER_AUTO -1

Expand Down

0 comments on commit 318e983

Please sign in to comment.