diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2025-04-09 09:59:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-09 09:59:06 +0200 |
| commit | 8418e57791eabc9feba637b69bd9ee35bed6860a (patch) | |
| tree | 48b9c05795135606782f9ec359c3f319f5d534dc /zebra/zebra_srv6.c | |
| parent | 1d426d99619b7818f4b63b52f83fadfe902b9854 (diff) | |
| parent | 27ba9956a15c17b7e8a6ba38aa8bbb4514fa90df (diff) | |
Merge pull request #17915 from mjstapp/compile_wshadow
Diffstat (limited to 'zebra/zebra_srv6.c')
| -rw-r--r-- | zebra/zebra_srv6.c | 58 |
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); } } |
