]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: skip unsupported PREFIX_SID sub-type
authorHiroki Shirokura <slank.dev@gmail.com>
Mon, 4 Nov 2019 17:33:50 +0000 (17:33 +0000)
committerHiroki Shirokura <slank.dev@gmail.com>
Tue, 5 Nov 2019 03:41:53 +0000 (03:41 +0000)
This commit make bgpd to skip and ignore unsupported
sub-type of PREFIX_SID. (especially new defined sub-type)
Current bgpd can't parase unsupported sub-type of PREFIX_SID.
PREFIX_SID is drafted on draft-ietf-idr-bgp-prefix-sid-27.
There are already new sub-type drafted on
draft-dawra-idr-srv6-vpn-05. (Type5,6 is new defined.)
This commit fix the problem reported as #5277 on GitBub.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
bgpd/bgp_attr.c
bgpd/bgp_attr.h

index 10e78cbc965f7ed0f4b90be0699146f9d89aa30d..bfa578085d7907e7960bfe403f201bd3d5d826f9 100644 (file)
@@ -2234,6 +2234,21 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(int32_t type,
                }
        }
 
+       /*
+        * Placeholder code for Unsupported TLV
+        *  - SRv6 L3 Service TLV (type5)
+        *  - SRv6 L2 Service TLV (type6)
+        */
+       else if (type == BGP_PREFIX_SID_SRV6_L3_SERVICE
+           || type == BGP_PREFIX_SID_SRV6_L2_SERVICE) {
+               if (bgp_debug_update(peer, NULL, NULL, 1))
+                       zlog_debug(
+                               "%s attr Prefix-SID sub-type=%u is not supported, skipped",
+                               peer->host, type);
+               for (int i = 0; i < length; i++)
+                       stream_getc(peer->curr);
+       }
+
        return BGP_ATTR_PARSE_PROCEED;
 }
 
index eacd37b6529bd916f5a565dbbe73f31ca5594c6b..42002bd37819d1c8d6186832d56b352a77438324 100644 (file)
@@ -62,6 +62,8 @@
 #define BGP_PREFIX_SID_LABEL_INDEX     1
 #define BGP_PREFIX_SID_IPV6            2
 #define BGP_PREFIX_SID_ORIGINATOR_SRGB 3
+#define BGP_PREFIX_SID_SRV6_L3_SERVICE 5
+#define BGP_PREFIX_SID_SRV6_L2_SERVICE 6
 
 #define BGP_PREFIX_SID_LABEL_INDEX_LENGTH      7
 #define BGP_PREFIX_SID_IPV6_LENGTH            19