From 0b76fb3c133951c8d1203dbe7c2e5a4e1b67dffe Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Sat, 15 Feb 2025 10:39:30 +0100 Subject: [PATCH 1/2] isisd: Add helper function to request SRv6 locator information This commit adds a function that iterates over all IS-IS areas and asks the SRv6 Manager for information about the configured locators. Signed-off-by: Carmine Scarpitta --- isisd/isis_srv6.c | 21 +++++++++++++++++++++ isisd/isis_srv6.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c index 4b97b5372e..f7a8733f76 100644 --- a/isisd/isis_srv6.c +++ b/isisd/isis_srv6.c @@ -657,6 +657,27 @@ int isis_srv6_ifp_up_notify(struct interface *ifp) return 0; } +/** + * Request SRv6 locator info from the SID Manager for all IS-IS areas where SRv6 + * is enabled and a locator has been configured. + * This function is called as soon as the connection with Zebra is established + * to get information about all configured locators. + */ +void isis_srv6_locators_request(void) +{ + struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT); + struct listnode *node; + struct isis_area *area; + + if (!isis) + return; + + for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) + if (area->srv6db.config.enabled && + area->srv6db.config.srv6_locator_name[0] != '\0' && !area->srv6db.srv6_locator) + isis_zebra_srv6_manager_get_locator(area->srv6db.config.srv6_locator_name); +} + /** * IS-IS SRv6 initialization for given area. * diff --git a/isisd/isis_srv6.h b/isisd/isis_srv6.h index eeb76c0b86..c2d6107367 100644 --- a/isisd/isis_srv6.h +++ b/isisd/isis_srv6.h @@ -155,6 +155,8 @@ isis_srv6_sid_alloc(struct isis_area *area, struct srv6_locator *locator, struct in6_addr *sid_value); extern void isis_srv6_sid_free(struct isis_srv6_sid *sid); +void isis_srv6_locators_request(void); + extern void isis_srv6_area_init(struct isis_area *area); extern void isis_srv6_area_term(struct isis_area *area); From f02dba19d20b0a53645a439924e736155c8de63f Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Sat, 15 Feb 2025 10:39:40 +0100 Subject: [PATCH 2/2] isisd: Request SRv6 locator after zebra connection When SRv6 is enabled and an SRv6 locator is specified in the IS-IS configuration, IS-IS may attempt to request SRv6 locator information from zebra before the connection is fully established. If this occurs, the request fails with the following error: ``` 2025/02/14 21:41:20 ISIS: [HR66R-TWQYD][EC 100663302] srv6_manager_get_locator: invalid zclient socket ```` As a result, IS-IS is unable to obtain the locator information, preventing SRv6 from working. This commit fixes the issue by ensuring IS-IS requests SRv6 locator information once the connection with zebra is successfully established. Signed-off-by: Carmine Scarpitta --- isisd/isis_zebra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index caf7d3ddfb..b985ad1f7d 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -805,6 +805,7 @@ static void isis_zebra_connected(struct zclient *zclient) zclient_register_opaque(zclient, LDP_IGP_SYNC_IF_STATE_UPDATE); zclient_register_opaque(zclient, LDP_IGP_SYNC_ANNOUNCE_UPDATE); bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER, VRF_DEFAULT); + isis_srv6_locators_request(); } /**