Skip to content

Commit

Permalink
isisd: Add MTID when packing SRv6 Locator TLV
Browse files Browse the repository at this point in the history
The SRv6 Locator TLV (RFC 9352 section sonic-net#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 <[email protected]>
  • Loading branch information
cscarpitta committed Sep 11, 2023
1 parent f5466cc commit cb55a1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions isisd/isis_tlvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5238,6 +5238,14 @@ static int pack_items_(uint16_t mtid, enum isis_tlv_context context,
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;
Expand Down

0 comments on commit cb55a1b

Please sign in to comment.