summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2024-05-02 23:50:38 +0200
committerCarmine Scarpitta <cscarpit@cisco.com>2024-06-13 14:54:16 +0200
commit5365c56614191c7184126fd1a32db20953f008eb (patch)
treeaf4aba03fd6dab0e6128d171cbdb4f2e90660ab3 /zebra
parentzebra: Notify daemons about SIDs (diff)
downloadfrr-5365c56614191c7184126fd1a32db20953f008eb.tar.xz
frr-5365c56614191c7184126fd1a32db20953f008eb.zip
zebra: Notify all daemons about locator delete
Currently, when a locator is deleted in zebra, zebra notifies only the zclient that owns the locator. With the introduction of SID Manager, the locator is no longer owned by any client. Instead, the locator is owned by Zebra, and clients can allocate and release SIDs from the locator using the ZAPI ZEBRA_SRV6_MANAGER_GET_SID and ZEBRA_SRV6_MANAGER_RELEASE_SID. Therefore, when a locator is removed in Zebra, we need to notify all daemons so that they can release/uninstall the SIDs allocated by that locator. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_srv6.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/zebra/zebra_srv6.c b/zebra/zebra_srv6.c
index 663afa2f8..aac4ba86a 100644
--- a/zebra/zebra_srv6.c
+++ b/zebra/zebra_srv6.c
@@ -634,7 +634,6 @@ void zebra_srv6_locator_add(struct srv6_locator *locator)
void zebra_srv6_locator_delete(struct srv6_locator *locator)
{
struct listnode *n;
- struct srv6_locator_chunk *c;
struct zebra_srv6 *srv6 = zebra_srv6_get_default();
struct zserv *client;
@@ -649,18 +648,8 @@ void zebra_srv6_locator_delete(struct srv6_locator *locator)
* by ZEBRA_SRV6_LOCATOR_DELETE, and this notification is sent to the
* owner of each chunk.
*/
- for (ALL_LIST_ELEMENTS_RO((struct list *)locator->chunks, n, c)) {
- if (c->proto == ZEBRA_ROUTE_SYSTEM)
- continue;
- client = zserv_find_client(c->proto, c->instance);
- if (!client) {
- zlog_warn(
- "%s: Not found zclient(proto=%u, instance=%u).",
- __func__, c->proto, c->instance);
- continue;
- }
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, n, client))
zsend_zebra_srv6_locator_delete(client, locator);
- }
listnode_delete(srv6->locators, locator);
srv6_locator_free(locator);
@@ -703,7 +692,6 @@ void zebra_notify_srv6_locator_add(struct srv6_locator *locator)
void zebra_notify_srv6_locator_delete(struct srv6_locator *locator)
{
struct listnode *n;
- struct srv6_locator_chunk *c;
struct zserv *client;
/*
@@ -717,17 +705,8 @@ void zebra_notify_srv6_locator_delete(struct srv6_locator *locator)
* by ZEBRA_SRV6_LOCATOR_DELETE, and this notification is sent to the
* owner of each chunk.
*/
- for (ALL_LIST_ELEMENTS_RO((struct list *)locator->chunks, n, c)) {
- if (c->proto == ZEBRA_ROUTE_SYSTEM)
- continue;
- client = zserv_find_client(c->proto, c->instance);
- if (!client) {
- zlog_warn("Not found zclient(proto=%u, instance=%u).",
- c->proto, c->instance);
- continue;
- }
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, n, client))
zsend_zebra_srv6_locator_delete(client, locator);
- }
}
struct zebra_srv6 srv6;