]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: Add free func for Sub-Sub-TLVs in general
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Fri, 17 Feb 2023 22:27:07 +0000 (23:27 +0100)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Mon, 11 Sep 2023 20:11:27 +0000 (22:11 +0200)
Add a function to free all the Sub-Sub-TLVs and the `isis_subsubtlvs`
data structure passed as an argument.

At this time, this function only frees the `isis_subsubtlvs`. It does
not free any specific Sub-Sub-TLVs because no Sub-Sub-TLVs have been
defined yet. This function will be extended in future commits to free
specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
isisd/isis_tlvs.c

index 5441db7833bb655ad877dd949d80608c61d7c40f..50110a4e2f9c07b76e991fc9d1d96d82adb205e3 100644 (file)
@@ -2006,6 +2006,14 @@ static void isis_format_subsubtlvs(struct isis_subsubtlvs *subsubtlvs,
 {
 }
 
+static void isis_free_subsubtlvs(struct isis_subsubtlvs *subsubtlvs)
+{
+       if (!subsubtlvs)
+               return;
+
+       XFREE(MTYPE_ISIS_SUBSUBTLV, subsubtlvs);
+}
+
 /* Functions related to subtlvs */
 
 static struct isis_subtlvs *isis_alloc_subtlvs(enum isis_tlv_context context)