]> git.puffer.fish Git - mirror/frr.git/commitdiff
pathd: clean up variable-shadow warnings
authorMark Stapp <mjs@cisco.com>
Thu, 30 Jan 2025 22:46:15 +0000 (17:46 -0500)
committerMark Stapp <mjs@cisco.com>
Tue, 8 Apr 2025 18:41:27 +0000 (14:41 -0400)
Clean up various variable-shadow warnings from -Wshadow

Signed-off-by: Mark Stapp <mjs@cisco.com>
pathd/path_ted.c
pathd/path_zebra.c

index 0f8d3827ff58e062676fc63848044c61c6875580..f9dff1f0194fcb0e2de53aa385bf840d2c2ce6a8 100644 (file)
@@ -31,7 +31,7 @@ static enum zclient_send_status path_ted_link_state_sync(void);
 static void path_ted_timer_handler_sync(struct event *thread);
 static void path_ted_timer_handler_refresh(struct event *thread);
 
-extern struct zclient *zclient;
+extern struct zclient *pathd_zclient;
 
 struct ted_state ted_state_g = { .dbg = { .conf = "debug pathd mpls-te",
                                          .desc = "Pathd TED" } };
@@ -40,9 +40,9 @@ struct ted_state ted_state_g = { .dbg = { .conf = "debug pathd mpls-te",
  * path_path_ted public API function implementations
  */
 
-void path_ted_init(struct event_loop *master)
+void path_ted_init(struct event_loop *loop)
 {
-       ted_state_g.main = master;
+       ted_state_g.main = loop;
        ted_state_g.link_state_delay_interval = TIMER_RETRY_DELAY;
        ted_state_g.segment_list_refresh_interval = TIMER_RETRY_DELAY;
        path_ted_register_vty();
@@ -82,7 +82,7 @@ uint32_t path_ted_start_importing_igp(const char *daemon_str)
                return 1;
        }
 
-       if (ls_register(zclient, false /*client*/) != 0) {
+       if (ls_register(pathd_zclient, false /*client*/) != 0) {
                PATH_TED_ERROR("%s: PATHD-TED: Unable to register Link State",
                               __func__);
                ted_state_g.import = IMPORT_UNKNOWN;
@@ -113,7 +113,7 @@ uint32_t path_ted_stop_importing_igp(void)
        uint32_t status = 0;
 
        if (ted_state_g.import != IMPORT_UNKNOWN) {
-               if (ls_unregister(zclient, false /*client*/) != 0) {
+               if (ls_unregister(pathd_zclient, false /*client*/) != 0) {
                        PATH_TED_ERROR(
                                "%s: PATHD-TED: Unable to unregister Link State",
                                __func__);
@@ -382,7 +382,7 @@ DEFUN (no_path_ted,
        ted_state_g.enabled = false;
        PATH_TED_DEBUG("%s: PATHD-TED: ON -> OFF", __func__);
        ted_state_g.import = IMPORT_UNKNOWN;
-       if (ls_unregister(zclient, false /*client*/) != 0) {
+       if (ls_unregister(pathd_zclient, false /*client*/) != 0) {
                vty_out(vty, "Unable to unregister Link State\n");
                return CMD_WARNING;
        }
@@ -538,7 +538,7 @@ enum zclient_send_status path_ted_link_state_sync(void)
 {
        enum zclient_send_status status;
 
-       status = ls_request_sync(zclient);
+       status = ls_request_sync(pathd_zclient);
        if (status == -1) {
                PATH_TED_ERROR(
                        "%s: PATHD-TED: Opaque error asking for TED sync ",
index ba03315c82f7dd1516bd092e4880c908ecf9c57c..1078b37dd6de44857fd3cebf4877ab4a4ced5da4 100644 (file)
@@ -26,7 +26,7 @@
 
 static int path_zebra_opaque_msg_handler(ZAPI_CALLBACK_ARGS);
 
-struct zclient *zclient;
+struct zclient *pathd_zclient;
 static struct zclient *zclient_sync;
 
 /* Event to retry synch zapi setup for label-manager */
@@ -189,7 +189,7 @@ void path_zebra_add_sr_policy(struct srte_policy *policy,
                        segment->sid_value;
        policy->status = SRTE_POLICY_STATUS_GOING_UP;
 
-       (void)zebra_send_sr_policy(zclient, ZEBRA_SR_POLICY_SET, &zp);
+       (void)zebra_send_sr_policy(pathd_zclient, ZEBRA_SR_POLICY_SET, &zp);
 }
 
 /**
@@ -209,7 +209,7 @@ void path_zebra_delete_sr_policy(struct srte_policy *policy)
        zp.segment_list.label_num = 0;
        policy->status = SRTE_POLICY_STATUS_DOWN;
 
-       (void)zebra_send_sr_policy(zclient, ZEBRA_SR_POLICY_DELETE, &zp);
+       (void)zebra_send_sr_policy(pathd_zclient, ZEBRA_SR_POLICY_DELETE, &zp);
 }
 
 /**
@@ -351,13 +351,13 @@ static zclient_handler *const path_handlers[] = {
  *
  * @param master The master thread
  */
-void path_zebra_init(struct event_loop *master)
+void path_zebra_init(struct event_loop *loop)
 {
        /* Initialize asynchronous zclient. */
-       zclient = zclient_new(master, &zclient_options_default, path_handlers,
-                             array_size(path_handlers));
-       zclient_init(zclient, ZEBRA_ROUTE_SRTE, 0, &pathd_privs);
-       zclient->zebra_connected = path_zebra_connected;
+       pathd_zclient = zclient_new(loop, &zclient_options_default, path_handlers,
+                                   array_size(path_handlers));
+       zclient_init(pathd_zclient, ZEBRA_ROUTE_SRTE, 0, &pathd_privs);
+       pathd_zclient->zebra_connected = path_zebra_connected;
 
        /* Initialize special zclient for synchronous message exchanges. */
        zclient_sync = zclient_new(master, &zclient_options_sync, NULL, 0);
@@ -373,8 +373,8 @@ void path_zebra_init(struct event_loop *master)
 
 void path_zebra_stop(void)
 {
-       zclient_stop(zclient);
-       zclient_free(zclient);
+       zclient_stop(pathd_zclient);
+       zclient_free(pathd_zclient);
        event_cancel(&t_sync_connect);
        zclient_stop(zclient_sync);
        zclient_free(zclient_sync);