]> git.puffer.fish Git - matthieu/frr.git/commitdiff
babeld: clean up -Wshadow warnings
authorMark Stapp <mjs@cisco.com>
Fri, 24 Jan 2025 19:44:46 +0000 (14:44 -0500)
committerMark Stapp <mjs@cisco.com>
Tue, 8 Apr 2025 18:41:27 +0000 (14:41 -0400)
Clean up various "shadow" warnings in babeld.

Signed-off-by: Mark Stapp <mjs@cisco.com>
babeld/babel_interface.c
babeld/babel_zebra.c
babeld/babel_zebra.h
babeld/babeld.c
babeld/kernel.c
babeld/route.h

index c99dadd083fdaee51015bad965a1c6f865f121c8..4653b96db4dde04fabec028124670206190dfac2 100644 (file)
@@ -755,8 +755,10 @@ babel_interface_close_all(void)
     }
     /* Disable babel redistribution */
     for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
-        zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP, type, 0, VRF_DEFAULT);
-        zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP6, type, 0, VRF_DEFAULT);
+        zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE, babel_zclient, AFI_IP, type, 0,
+                            VRF_DEFAULT);
+        zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE, babel_zclient, AFI_IP6, type, 0,
+                            VRF_DEFAULT);
     }
 }
 
@@ -974,6 +976,7 @@ DEFUN (show_babel_route,
 {
     struct route_stream *routes = NULL;
     struct xroute_stream *xroutes = NULL;
+
     routes = route_stream(0);
     if(routes) {
         while(1) {
index bead9f27ef1672bd99e296f1ff833481dc7cb5cc..54f0f79aa0d193b17abc39e08914f89b866c11a0 100644 (file)
@@ -19,7 +19,7 @@ void babelz_zebra_init(void);
 
 
 /* we must use a pointer because of zclient.c's functions (new, free). */
-struct zclient *zclient;
+struct zclient *babel_zclient;
 
 /* Debug types */
 static const struct {
@@ -94,9 +94,10 @@ DEFUN (babel_redistribute_type,
     }
 
     if (!negate)
-        zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, afi, type, 0, VRF_DEFAULT);
+        zclient_redistribute(ZEBRA_REDISTRIBUTE_ADD, babel_zclient, afi, type, 0, VRF_DEFAULT);
     else {
-        zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, afi, type, 0, VRF_DEFAULT);
+        zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE, babel_zclient, afi, type, 0,
+                            VRF_DEFAULT);
         /* perhaps should we remove xroutes having the same type... */
     }
     return CMD_SUCCESS;
@@ -230,11 +231,11 @@ static zclient_handler *const babel_handlers[] = {
 
 void babelz_zebra_init(void)
 {
-    zclient = zclient_new(master, &zclient_options_default, babel_handlers,
-                         array_size(babel_handlers));
-    zclient_init(zclient, ZEBRA_ROUTE_BABEL, 0, &babeld_privs);
+    babel_zclient = zclient_new(master, &zclient_options_default, babel_handlers,
+                               array_size(babel_handlers));
+    zclient_init(babel_zclient, ZEBRA_ROUTE_BABEL, 0, &babeld_privs);
 
-    zclient->zebra_connected = babel_zebra_connected;
+    babel_zclient->zebra_connected = babel_zebra_connected;
 
     install_element(BABEL_NODE, &babel_redistribute_type_cmd);
     install_element(ENABLE_NODE, &debug_babel_cmd);
@@ -248,6 +249,6 @@ void babelz_zebra_init(void)
 void
 babel_zebra_close_connexion(void)
 {
-    zclient_stop(zclient);
-    zclient_free(zclient);
+    zclient_stop(babel_zclient);
+    zclient_free(babel_zclient);
 }
index 7f960d3961d69b51553e9da5255696068842a070..0455bad7e1b8a52b3ff73b70035e0e1ede392529 100644 (file)
@@ -8,7 +8,7 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
 
 #include "vty.h"
 
-extern struct zclient *zclient;
+extern struct zclient *babel_zclient;
 
 void babelz_zebra_init(void);
 void babel_zebra_close_connexion(void);
index 4e68f05df4319fffe5302ae3ff5843ed7105df0d..4dff01ba3a19d594e8165bcb793acb8b0d4b5b50 100644 (file)
@@ -108,8 +108,8 @@ babel_config_write (struct vty *vty)
     /* list redistributed protocols */
     for (afi = AFI_IP; afi <= AFI_IP6; afi++) {
         for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
-               if (i != zclient->redist_default &&
-                   vrf_bitmap_check(&zclient->redist[afi][i], VRF_DEFAULT)) {
+               if (i != babel_zclient->redist_default &&
+                   vrf_bitmap_check(&babel_zclient->redist[afi][i], VRF_DEFAULT)) {
                        vty_out(vty, " redistribute %s %s\n",
                                (afi == AFI_IP) ? "ipv4" : "ipv6",
                                zebra_route_string(i));
index 4957b04e77d9711ad6d4e47df09af1b69e79c358..ec562a9e933046f9c68bfa66d25566436c2942e0 100644 (file)
@@ -176,8 +176,7 @@ zebra_route(int add, int family, const unsigned char *pref, unsigned short plen,
     debugf(BABEL_DEBUG_ROUTE, "%s route (%s) to zebra",
            add ? "adding" : "removing",
            (family == AF_INET) ? "ipv4" : "ipv6");
-    return zclient_route_send (add ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE,
-                               zclient, &api);
+    return zclient_route_send(add ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE, babel_zclient, &api);
 }
 
 int
index 89427b84152515379b082a4af9710b3db30f9bc8..ec050fd87b6badbf621053d358cb99a4921af5e8 100644 (file)
@@ -38,7 +38,6 @@ struct babel_route {
 
 struct route_stream;
 
-extern struct babel_route **routes;
 extern int kernel_metric;
 extern enum babel_diversity diversity_kind;
 extern int diversity_factor;