]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Check if cluster list attribute is not received via eBGP session
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 7 Jul 2023 12:07:11 +0000 (15:07 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 7 Jul 2023 20:02:18 +0000 (23:02 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_attr.c

index b5cdcfd2df4d2d1ad911ce326c707709899a89fa..63705fb155d8ba519bd8d5ddad6522b8f3a0c0e1 100644 (file)
@@ -2183,6 +2183,15 @@ bgp_attr_cluster_list(struct bgp_attr_parser_args *args)
        struct attr *const attr = args->attr;
        const bgp_size_t length = args->length;
 
+       /* if the CLUSTER_LIST attribute is received from an external
+        * neighbor, it SHALL be discarded using the approach of "attribute
+        * discard".
+        */
+       if (peer->sort == BGP_PEER_EBGP) {
+               stream_forward_getp(peer->curr, length);
+               return BGP_ATTR_PARSE_PROCEED;
+       }
+
        /* if received from an internal neighbor, it SHALL be considered
         * malformed if its length is not a non-zero multiple of 4.  If
         * malformed, the UPDATE message SHALL be handled using the approach