Commit 583baa3805 for frr

commit 583baa380561143c9ee84a56c07f7c54f905f779
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date:   Mon Nov 30 16:36:30 2026 +0100

    lib: fix the json display of the srv6 adjacency sids of an edge

    isisd aborts when the json display of a TED edge with an SRv6 End.X SID,
    but without MPLS Adj-SID, is requested, for instance an edge of the IS-IS
    IPv6 unicast topology in an SRv6 network:

    > rt1# show isis mpls-te database edge 2001:db8:24::2 json
    > ISIS: Received signal 6 at 1796052230 (si_addr 0x20109, PC 0x7b5515a9ec0c); aborting...
    > ISIS: /lib/x86_64-linux-gnu/libjson-c.so.5(+0x603a) [0x7b551731a03a]
    > ISIS: /lib/libfrr.so.0(+0x27833d) [0x7b551667833d]
    > ISIS: /lib/libfrr.so.0(ls_show_edge+0x3e) [0x7b5516678648]

    ls_show_edge_json() adds the json objects of the primary and backup
    SRv6 End.X SIDs to the array of the MPLS Adj-SIDs, jsr, instead of the
    "segment-routing-ipv6" array, jsrv6, created for them. jsr is NULL when
    the edge has no MPLS Adj-SID, and json-c asserts on it. Otherwise, the
    SRv6 End.X SIDs are shown in the "segment-routing" array, and the
    "segment-routing-ipv6" array is empty.

    Fix this by adding the SRv6 End.X SIDs to jsrv6.

    Fixes: 196f0d69fa26 ("isisd, lib: add link state support for srv6 adjacencies")
    Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>

diff --git a/lib/link_state.c b/lib/link_state.c
index 1cc65b6281..fd59242c5f 100644
--- a/lib/link_state.c
+++ b/lib/link_state.c
@@ -2859,7 +2859,7 @@ static void ls_show_edge_json(struct ls_edge *edge, struct json_object *json)
 			   attr->adj_srv6_sid[ADJ_SRV6_PRI_IPV6]
 				   .endpoint_behavior);
 		json_object_string_add(jobj, "endpoint-behavior", buf);
-		json_object_array_add(jsr, jobj);
+		json_object_array_add(jsrv6, jobj);
 	}
 	if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SRV6SID)) {
 		if (!jsrv6) {
@@ -2880,7 +2880,7 @@ static void ls_show_edge_json(struct ls_edge *edge, struct json_object *json)
 			   attr->adj_srv6_sid[ADJ_SRV6_BCK_IPV6]
 				   .endpoint_behavior);
 		json_object_string_add(jobj, "endpoint-behavior", buf);
-		json_object_array_add(jsr, jobj);
+		json_object_array_add(jsrv6, jobj);
 	}
 }