babeld: clean up -Wshadow warnings

Clean up various "shadow" warnings in babeld.

Signed-off-by: Mark Stapp <mjs@cisco.com>
This commit is contained in:
Mark Stapp 2025-01-24 14:44:46 -05:00
parent 5be982966c
commit e636398908
6 changed files with 19 additions and 17 deletions

View 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) {

View 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);
}

View 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);

View 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));

View 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

View 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;