]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: Add MTID when packing SRv6 Locator TLV
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Sat, 3 Jun 2023 11:28:35 +0000 (13:28 +0200)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Mon, 11 Sep 2023 15:35:15 +0000 (17:35 +0200)
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>
isisd/isis_tlvs.c

index 9f12b402355ab234bb57e05011824827f21a31dc..81fb93e4b4c5413dbf536c1e2fa223a100428413 100644 (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;