mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 23:08:38 +00:00
lib: move flex_algo_delete() just after flex_algo_alloc()
Move flex_algo_delete() just after flex_algo_alloc(). No change on code. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
8b8861401a
commit
8766fceefc
@ -48,6 +48,25 @@ struct flex_algo *flex_algo_alloc(struct flex_algos *flex_algos,
|
|||||||
return fa;
|
return fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void flex_algo_delete(struct flex_algos *flex_algos, uint8_t algorithm)
|
||||||
|
{
|
||||||
|
struct listnode *node, *nnode;
|
||||||
|
struct flex_algo *fa;
|
||||||
|
|
||||||
|
for (ALL_LIST_ELEMENTS(flex_algos->flex_algos, node, nnode, fa)) {
|
||||||
|
if (fa->algorithm != algorithm)
|
||||||
|
continue;
|
||||||
|
if (flex_algos->releaser)
|
||||||
|
flex_algos->releaser(fa->data);
|
||||||
|
admin_group_term(&fa->admin_group_exclude_any);
|
||||||
|
admin_group_term(&fa->admin_group_include_any);
|
||||||
|
admin_group_term(&fa->admin_group_include_all);
|
||||||
|
listnode_delete(flex_algos->flex_algos, fa);
|
||||||
|
XFREE(MTYPE_FLEX_ALGO, fa);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Look up the local flex-algo object by its algorithm number.
|
* @brief Look up the local flex-algo object by its algorithm number.
|
||||||
* @param algorithm flex-algo algorithm number
|
* @param algorithm flex-algo algorithm number
|
||||||
@ -94,25 +113,6 @@ bool flex_algo_definition_cmp(struct flex_algo *fa1, struct flex_algo *fa2)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flex_algo_delete(struct flex_algos *flex_algos, uint8_t algorithm)
|
|
||||||
{
|
|
||||||
struct listnode *node, *nnode;
|
|
||||||
struct flex_algo *fa;
|
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(flex_algos->flex_algos, node, nnode, fa)) {
|
|
||||||
if (fa->algorithm != algorithm)
|
|
||||||
continue;
|
|
||||||
if (flex_algos->releaser)
|
|
||||||
flex_algos->releaser(fa->data);
|
|
||||||
admin_group_term(&fa->admin_group_exclude_any);
|
|
||||||
admin_group_term(&fa->admin_group_include_any);
|
|
||||||
admin_group_term(&fa->admin_group_include_all);
|
|
||||||
listnode_delete(flex_algos->flex_algos, fa);
|
|
||||||
XFREE(MTYPE_FLEX_ALGO, fa);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check SR Algorithm is Flex-Algo
|
* Check SR Algorithm is Flex-Algo
|
||||||
* according to RFC9350 section 4
|
* according to RFC9350 section 4
|
||||||
|
Loading…
Reference in New Issue
Block a user