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 <carmine.scarpitta@uniroma2.it>
This commit is contained in:
Carmine Scarpitta 2023-06-03 13:28:35 +02:00
parent f5466cc8f6
commit cb55a1bb9b

View File

@ -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;