]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Treat PMSI tunnel attribute as withdrawn if malformed
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 1 Sep 2023 14:00:55 +0000 (17:00 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 5 Sep 2023 12:33:53 +0000 (12:33 +0000)
https://datatracker.ietf.org/doc/html/rfc6514#page-10 states:

A router that supports the PMSI Tunnel attribute considers this
   attribute to be malformed if either (a) it contains an undefined
   tunnel type in the Tunnel Type field of the attribute, or (b) the
   router cannot parse the Tunnel Identifier field of the attribute as a
   tunnel identifier of the tunnel types specified in the Tunnel Type
   field of the attribute.

When a router that receives a BGP Update that contains the PMSI
   Tunnel attribute with its Partial bit set determines that the
   attribute is malformed, the router SHOULD treat this Update as though
   all the routes contained in this Update had been withdrawn.

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

bgpd/bgp_attr.c

index 14e107c3acdf976b19e4e680a89472c237749c38..698e09db99d12bbbf2645070bac2847977a1ab69 100644 (file)
@@ -1400,6 +1400,7 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode,
        case BGP_ATTR_LARGE_COMMUNITIES:
        case BGP_ATTR_ORIGINATOR_ID:
        case BGP_ATTR_CLUSTER_LIST:
+       case BGP_ATTR_PMSI_TUNNEL:
        case BGP_ATTR_ENCAP:
        case BGP_ATTR_OTC:
                return BGP_ATTR_PARSE_WITHDRAW;