summaryrefslogtreecommitdiff
path: root/isisd/isis_srv6.c
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2024-05-09 13:00:30 +0200
committerCarmine Scarpitta <cscarpit@cisco.com>2024-06-18 18:33:29 +0200
commit38a62df517bf86941ce60410ab332d893c6b8b2e (patch)
tree193c6ecfa36e50078af5a8db13aab08b49266d11 /isisd/isis_srv6.c
parent1224d15653b98db5b6a7c671501b7ec80b3ce649 (diff)
isisd: Request SRv6 SIDs to SID Manager
Currently, IS-IS allocates SIDs without interacting with Zebra. Recently, the SRv6 implementation has been improved. Now, the daemons need to interact with Zebra through ZAPI to obtain and release SIDs. This commit extends IS-IS to request SIDs from Zebra instead of allocating the SIDs on its own. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Diffstat (limited to 'isisd/isis_srv6.c')
-rw-r--r--isisd/isis_srv6.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c
index 7cf1d91b46..0cd7f847f8 100644
--- a/isisd/isis_srv6.c
+++ b/isisd/isis_srv6.c
@@ -318,25 +318,23 @@ static struct in6_addr srv6_locator_request_sid(struct isis_area *area,
* @param area IS-IS area
* @param locator SRv6 locator
* @param behavior SRv6 Endpoint Behavior bound to the SID
+ * @param sid_value SRv6 SID value
*
* @result the allocated SID on success, NULL otherwise
*/
struct isis_srv6_sid *
isis_srv6_sid_alloc(struct isis_area *area, struct srv6_locator *locator,
- enum srv6_endpoint_behavior_codepoint behavior, int sid_func)
+ enum srv6_endpoint_behavior_codepoint behavior,
+ struct in6_addr *sid_value)
{
struct isis_srv6_sid *sid = NULL;
- if (!area || !locator)
+ if (!area || !locator || !sid_value)
return NULL;
sid = XCALLOC(MTYPE_ISIS_SRV6_SID, sizeof(struct isis_srv6_sid));
- sid->sid = srv6_locator_request_sid(area, locator, sid_func);
- if (IPV6_ADDR_SAME(&sid->sid, &in6addr_any)) {
- isis_srv6_sid_free(sid);
- return NULL;
- }
+ sid->sid = *sid_value;
sid->behavior = behavior;
sid->structure.loc_block_len = locator->block_bits_length;
@@ -379,9 +377,10 @@ void isis_area_delete_backup_srv6_endx_sids(struct isis_area *area, int level)
* @param adj IS-IS Adjacency
* @param backup True to initialize backup Adjacency SID
* @param nexthops List of backup nexthops (for backup End.X SIDs only)
+ * @param sid_value SID value associated to be associated with the adjacency
*/
void srv6_endx_sid_add_single(struct isis_adjacency *adj, bool backup,
- struct list *nexthops)
+ struct list *nexthops, struct in6_addr *sid_value)
{
struct isis_circuit *circuit = adj->circuit;
struct isis_area *area = circuit->area;
@@ -428,11 +427,7 @@ void srv6_endx_sid_add_single(struct isis_adjacency *adj, bool backup,
sra->structure.arg_len = locator->argument_bits_length;
sra->nexthop = nexthop;
- sra->sid = srv6_locator_request_sid(area, locator, -1);
- if (IPV6_ADDR_SAME(&sra->sid, &in6addr_any)) {
- XFREE(MTYPE_ISIS_SRV6_INFO, sra);
- return;
- }
+ sra->sid = *sid_value;
switch (circuit->circ_type) {
/* SRv6 LAN End.X SID for Broadcast interface section #8.2 */
@@ -504,9 +499,9 @@ void srv6_endx_sid_add_single(struct isis_adjacency *adj, bool backup,
*
* @param adj IS-IS Adjacency
*/
-void srv6_endx_sid_add(struct isis_adjacency *adj)
+void srv6_endx_sid_add(struct isis_adjacency *adj, struct in6_addr *sid_value)
{
- srv6_endx_sid_add_single(adj, false, NULL);
+ srv6_endx_sid_add_single(adj, false, NULL, sid_value);
}
/**
@@ -609,7 +604,7 @@ static int srv6_adj_ip_enabled(struct isis_adjacency *adj, int family,
family != AF_INET6)
return 0;
- srv6_endx_sid_add(adj);
+ isis_zebra_request_srv6_sid_endx(adj);
return 0;
}