]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Treat numbered community-list only if it's in a range 1-500
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 30 Oct 2024 08:45:28 +0000 (10:45 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 5 Nov 2024 15:17:25 +0000 (15:17 +0000)
Before this patch, if we set something like:

```
bgp extcommunity-list expanded 1234 permit admin
```

In running config we have:

```
bgp extcommunity-list 1234 seq 5 permit admin
```

That leads to incorrect rendering, even more the line can't be deleted.

With this fix we treat numbered community-list only if it's inside the range
1-500, otherwise it's a non-numbered clist.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 4c1ee29116aff081f63b1fc7dad18cbfe1b8007f)

bgpd/bgp_clist.c
bgpd/bgp_clist.h

index ad154e638b55b455fe940e370872fe27ce093b19..61ba527498ca44bdb48c5076150666c92a547a09 100644 (file)
@@ -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. */
index 29bd880c937ee10bfd67e7c934f48e5436923a2b..7f35a6d53e4b0bdf4ae49f99f6849a6960ee3383 100644 (file)
 /* 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