summaryrefslogtreecommitdiffstats
path: root/isisd/isis_tlvs.h
diff options
context:
space:
mode:
authorOlivier Dugeon <olivier.dugeon@orange.com>2020-06-23 16:31:55 +0200
committerOlivier Dugeon <olivier.dugeon@orange.com>2020-06-23 19:20:39 +0200
commite075df3a05397a4623bbe07b63551e458bb89b65 (patch)
tree432c65cb5001ee16cd8fcf79bb93f186ed864d5a /isisd/isis_tlvs.h
parentisisd: Start Label Manager safer (diff)
downloadfrr-e075df3a05397a4623bbe07b63551e458bb89b65.tar.xz
frr-e075df3a05397a4623bbe07b63551e458bb89b65.zip
isisd: Segment Routing improve subTLVs parser
For Segment Routing, isis_tlvs.c may failed if incorrect or maformed TLVs are sent to the FRR router. This patch improve detection of such subTLVs error and skip them, in particular for SRGB, SRLB and MSD subTLVs. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'isisd/isis_tlvs.h')
-rw-r--r--isisd/isis_tlvs.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/isisd/isis_tlvs.h b/isisd/isis_tlvs.h
index 0cf49b526..1c0d97f2c 100644
--- a/isisd/isis_tlvs.h
+++ b/isisd/isis_tlvs.h
@@ -140,6 +140,9 @@ struct isis_threeway_adj {
#define ISIS_SUBTLV_SRGB_FLAG_V 0x40
#define IS_SR_IPV4(srgb) (srgb.flags & ISIS_SUBTLV_SRGB_FLAG_I)
#define IS_SR_IPV6(srgb) (srgb.flags & ISIS_SUBTLV_SRGB_FLAG_V)
+#define SUBTLV_SR_BLOCK_SIZE 6
+#define SUBTLV_RANGE_INDEX_SIZE 10
+#define SUBTLV_RANGE_LABEL_SIZE 9
/* Structure aggregating SR Global (SRGB) or Local (SRLB) Block info */
struct isis_sr_block {
@@ -209,6 +212,9 @@ struct isis_lan_adj_sid {
#define SR_ALGORITHM_STRICT_SPF 1
#define SR_ALGORITHM_UNSET 255
+#define MSD_TYPE_BASE_MPLS_IMPOSITION 0x01
+#define MSD_TLV_SIZE 2
+
struct isis_router_cap {
struct in_addr router_id;
uint8_t flags;
@@ -218,7 +224,6 @@ struct isis_router_cap {
struct isis_sr_block srlb;
uint8_t algo[SR_ALGORITHM_COUNT];
/* RFC 8491 */
-#define MSD_TYPE_BASE_MPLS_IMPOSITION 0x01
uint8_t msd;
};