summaryrefslogtreecommitdiff
path: root/zebra/zebra_srv6.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@cisco.com>2025-03-26 14:54:30 -0400
committerMark Stapp <mjs@cisco.com>2025-04-08 14:41:27 -0400
commit7c98a27f3e53d543284c89d7518ba3b0d77278d4 (patch)
treece5b8fcc1e3673d9bf2b50492f2ca82ab747537a /zebra/zebra_srv6.c
parenta2acd59afd4a611a214f68b255861f6f2753a51f (diff)
zebra: clean up -Wshadow compiler warnings
Clean up variable-shadowing compiler warnings. Signed-off-by: Mark Stapp <mjs@cisco.com>
Diffstat (limited to 'zebra/zebra_srv6.c')
-rw-r--r--zebra/zebra_srv6.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/zebra/zebra_srv6.c b/zebra/zebra_srv6.c
index ebfd5c0908..ee0d6c41c6 100644
--- a/zebra/zebra_srv6.c
+++ b/zebra/zebra_srv6.c
@@ -36,6 +36,8 @@ DEFINE_MTYPE_STATIC(SRV6_MGR, ZEBRA_SRV6_USID_WLIB,
DEFINE_MTYPE_STATIC(SRV6_MGR, ZEBRA_SRV6_SID, "SRv6 SID");
DEFINE_MTYPE_STATIC(SRV6_MGR, ZEBRA_SRV6_SID_CTX, "SRv6 SID context");
+static struct zebra_srv6 g_srv6;
+
/* Prototypes */
static int release_srv6_sid_func_dynamic(struct zebra_srv6_sid_block *block,
uint32_t sid_func);
@@ -705,8 +707,6 @@ void zebra_notify_srv6_locator_delete(struct srv6_locator *locator)
}
}
-struct zebra_srv6 srv6;
-
struct zebra_srv6 *zebra_srv6_get_default(void)
{
static bool first_execution = true;
@@ -715,11 +715,11 @@ struct zebra_srv6 *zebra_srv6_get_default(void)
if (first_execution) {
first_execution = false;
- srv6.locators = list_new();
+ g_srv6.locators = list_new();
/* Initialize list of SID formats */
- srv6.sid_formats = list_new();
- srv6.sid_formats->del = delete_srv6_sid_format;
+ g_srv6.sid_formats = list_new();
+ g_srv6.sid_formats->del = delete_srv6_sid_format;
/* Create SID format `usid-f3216` */
format_usidf3216 = create_srv6_sid_format_usid_f3216();
@@ -730,14 +730,14 @@ struct zebra_srv6 *zebra_srv6_get_default(void)
srv6_sid_format_register(format_uncompressed);
/* Init list to store SRv6 SIDs */
- srv6.sids = list_new();
- srv6.sids->del = delete_zebra_srv6_sid_ctx;
+ g_srv6.sids = list_new();
+ g_srv6.sids->del = delete_zebra_srv6_sid_ctx;
/* Init list to store SRv6 SID blocks */
- srv6.sid_blocks = list_new();
- srv6.sid_blocks->del = delete_zebra_srv6_sid_block;
+ g_srv6.sid_blocks = list_new();
+ g_srv6.sid_blocks->del = delete_zebra_srv6_sid_block;
}
- return &srv6;
+ return &g_srv6;
}
/**
@@ -2455,51 +2455,51 @@ void zebra_srv6_terminate(void)
struct zebra_srv6_sid_block *block;
struct zebra_srv6_sid_ctx *sid_ctx;
- if (srv6.locators) {
- while (listcount(srv6.locators)) {
- locator = listnode_head(srv6.locators);
+ if (g_srv6.locators) {
+ while (listcount(g_srv6.locators)) {
+ locator = listnode_head(g_srv6.locators);
- listnode_delete(srv6.locators, locator);
+ listnode_delete(g_srv6.locators, locator);
srv6_locator_free(locator);
}
- list_delete(&srv6.locators);
+ list_delete(&g_srv6.locators);
}
/* Free SRv6 SIDs */
- if (srv6.sids) {
- while (listcount(srv6.sids)) {
- sid_ctx = listnode_head(srv6.sids);
+ if (g_srv6.sids) {
+ while (listcount(g_srv6.sids)) {
+ sid_ctx = listnode_head(g_srv6.sids);
- listnode_delete(srv6.sids, sid_ctx);
+ listnode_delete(g_srv6.sids, sid_ctx);
zebra_srv6_sid_ctx_free(sid_ctx);
}
- list_delete(&srv6.sids);
+ list_delete(&g_srv6.sids);
}
/* Free SRv6 SID blocks */
- if (srv6.sid_blocks) {
- while (listcount(srv6.sid_blocks)) {
- block = listnode_head(srv6.sid_blocks);
+ if (g_srv6.sid_blocks) {
+ while (listcount(g_srv6.sid_blocks)) {
+ block = listnode_head(g_srv6.sid_blocks);
- listnode_delete(srv6.sid_blocks, block);
+ listnode_delete(g_srv6.sid_blocks, block);
zebra_srv6_sid_block_free(block);
}
- list_delete(&srv6.sid_blocks);
+ list_delete(&g_srv6.sid_blocks);
}
/* Free SRv6 SID formats */
- if (srv6.sid_formats) {
- while (listcount(srv6.sid_formats)) {
- format = listnode_head(srv6.sid_formats);
+ if (g_srv6.sid_formats) {
+ while (listcount(g_srv6.sid_formats)) {
+ format = listnode_head(g_srv6.sid_formats);
srv6_sid_format_unregister(format);
srv6_sid_format_free(format);
}
- list_delete(&srv6.sid_formats);
+ list_delete(&g_srv6.sid_formats);
}
}