mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 05:42:23 +00:00
Merge pull request #8807 from mjstapp/fix_srv6_delete
lib,zebra: srv6 cleanup
This commit is contained in:
commit
6dbaa012be
@ -129,6 +129,8 @@ struct srv6_locator *srv6_locator_alloc(const char *name)
|
||||
locator = XCALLOC(MTYPE_SRV6_LOCATOR, sizeof(struct srv6_locator));
|
||||
strlcpy(locator->name, name, sizeof(locator->name));
|
||||
locator->chunks = list_new();
|
||||
locator->chunks->del = (void (*)(void *))srv6_locator_chunk_free;
|
||||
|
||||
QOBJ_REG(locator, srv6_locator);
|
||||
return locator;
|
||||
}
|
||||
@ -144,7 +146,12 @@ struct srv6_locator_chunk *srv6_locator_chunk_alloc(void)
|
||||
|
||||
void srv6_locator_free(struct srv6_locator *locator)
|
||||
{
|
||||
XFREE(MTYPE_SRV6_LOCATOR, locator);
|
||||
if (locator) {
|
||||
QOBJ_UNREG(locator);
|
||||
list_delete(&locator->chunks);
|
||||
|
||||
XFREE(MTYPE_SRV6_LOCATOR, locator);
|
||||
}
|
||||
}
|
||||
|
||||
void srv6_locator_chunk_free(struct srv6_locator_chunk *chunk)
|
||||
|
@ -2848,7 +2848,7 @@ stream_failure:
|
||||
|
||||
static void zread_table_manager_request(ZAPI_HANDLER_ARGS)
|
||||
{
|
||||
/* to avoid sending other messages like ZERBA_INTERFACE_UP */
|
||||
/* to avoid sending other messages like ZEBRA_INTERFACE_UP */
|
||||
if (hdr->command == ZEBRA_TABLE_MANAGER_CONNECT)
|
||||
zread_table_manager_connect(client, msg, zvrf_id(zvrf));
|
||||
else {
|
||||
@ -2856,7 +2856,7 @@ static void zread_table_manager_request(ZAPI_HANDLER_ARGS)
|
||||
if (!client->proto) {
|
||||
flog_err(
|
||||
EC_ZEBRA_TM_ALIENS,
|
||||
"Got table request from an unidentified client");
|
||||
"Got SRv6 request from an unidentified client");
|
||||
return;
|
||||
}
|
||||
if (hdr->command == ZEBRA_GET_TABLE_CHUNK)
|
||||
|
@ -181,13 +181,13 @@ assign_srv6_locator_chunk(uint8_t proto,
|
||||
|
||||
loc->status_up = false;
|
||||
chunk = srv6_locator_chunk_alloc();
|
||||
chunk->proto = 0;
|
||||
chunk->proto = NO_PROTO;
|
||||
listnode_add(loc->chunks, chunk);
|
||||
zebra_srv6_locator_add(loc);
|
||||
}
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO((struct list *)loc->chunks, node, chunk)) {
|
||||
if (chunk->proto != 0 && chunk->proto != proto)
|
||||
if (chunk->proto != NO_PROTO && chunk->proto != proto)
|
||||
continue;
|
||||
chunk_found = true;
|
||||
break;
|
||||
@ -199,6 +199,8 @@ assign_srv6_locator_chunk(uint8_t proto,
|
||||
}
|
||||
|
||||
chunk->proto = proto;
|
||||
chunk->instance = instance;
|
||||
chunk->session_id = session_id;
|
||||
return loc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user