diff options
| author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-06-03 12:11:27 +0200 | 
|---|---|---|
| committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-09-11 22:11:30 +0200 | 
| commit | bc6e273046a6ee8c51bb165aab68380440def8e1 (patch) | |
| tree | 479e45563a687af4b7a65ac0096c4b0dde04d1e4 /isisd/isis_tlvs.c | |
| parent | 422ea2d410a7b9dd23d2ff9f58c5ee3eff2b12aa (diff) | |
isisd: Pack Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Extend SRv6 End SID Sub-TLV pack function to pack Sub-Sub-TLVs (RFC 9352
section #9).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'isisd/isis_tlvs.c')
| -rw-r--r-- | isisd/isis_tlvs.c | 18 | 
1 files changed, 15 insertions, 3 deletions
diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index ec3cce391e..2a17d79ef1 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -2209,9 +2209,21 @@ static int pack_item_srv6_end_sid(struct isis_item *i, struct stream *s,  	stream_putw(s, sid->behavior);  	stream_put(s, &sid->sid, IPV6_MAX_BYTELEN); -	/* Put 0 as Sub-Sub-TLV length, because we don't support any Sub-Sub-TLV -	 * at this time */ -	stream_putc(s, 0); +	if (sid->subsubtlvs) { +		/* Pack Sub-Sub-TLVs */ +		if (isis_pack_subsubtlvs(sid->subsubtlvs, s)) +			return 1; +	} else { +		/* No Sub-Sub-TLVs */ +		if (STREAM_WRITEABLE(s) < 1) { +			*min_len = 20; +			return 1; +		} + +		/* Put 0 as Sub-Sub-TLV length, because we have no Sub-Sub-TLVs +		 */ +		stream_putc(s, 0); +	}  	return 0;  }  | 
