From cb55a1bb9b8e62fddb646f8bce43f1f128579637 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Sat, 3 Jun 2023 13:28:35 +0200 Subject: [PATCH] isisd: Add MTID when packing SRv6 Locator TLV The SRv6 Locator TLV (RFC 9352 section #7.1) starts with the MTID field. Let's put the MTID as the first field when we are packing an SRv6 Locator TLV. Signed-off-by: Carmine Scarpitta --- isisd/isis_tlvs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 9f12b40235..81fb93e4b4 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -5238,6 +5238,14 @@ top: stream_putw(s, mtid); } + /* The SRv6 Locator TLV (RFC 9352 section #7.1) starts with the MTID + * field */ + if (context == ISIS_CONTEXT_LSP && type == ISIS_TLV_SRV6_LOCATOR) { + if (STREAM_WRITEABLE(s) < 2) + goto too_long; + stream_putw(s, mtid); + } + if (context == ISIS_CONTEXT_LSP && type == ISIS_TLV_OLDSTYLE_REACH) { if (STREAM_WRITEABLE(s) < 1) goto too_long;