diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-01-27 10:50:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 10:50:27 +0100 |
commit | a2ec3f48ef69daf0bfbda5b9c2e19b3230d31b73 (patch) | |
tree | 1613689f8ec289be0a97358d4ad5ba2b0b8c52ee | |
parent | Merge pull request #12694 from donaldsharp/zebra_rib_dead_code (diff) | |
parent | lib: Remove global variable exposure `struct host host` (diff) | |
download | frr-a2ec3f48ef69daf0bfbda5b9c2e19b3230d31b73.tar.xz frr-a2ec3f48ef69daf0bfbda5b9c2e19b3230d31b73.zip |
Merge pull request #12696 from donaldsharp/shadowed
Shadowed
-rw-r--r-- | lib/command.h | 3 | ||||
-rw-r--r-- | lib/frrscript.h | 2 | ||||
-rw-r--r-- | lib/grammar_sandbox_main.c | 4 | ||||
-rw-r--r-- | watchfrr/watchfrr.c | 11 | ||||
-rw-r--r-- | zebra/zebra_nhg.c | 9 |
5 files changed, 12 insertions, 17 deletions
diff --git a/lib/command.h b/lib/command.h index bce4fb9e1..8f5d96053 100644 --- a/lib/command.h +++ b/lib/command.h @@ -619,9 +619,6 @@ extern void print_version(const char *); extern int cmd_banner_motd_file(const char *); extern void cmd_banner_motd_line(const char *line); -/* struct host global, ick */ -extern struct host host; - struct cmd_variable_handler { const char *tokenname, *varname; void (*completions)(vector out, struct cmd_token *token); diff --git a/lib/frrscript.h b/lib/frrscript.h index 7fa01f70d..afaab66f1 100644 --- a/lib/frrscript.h +++ b/lib/frrscript.h @@ -34,7 +34,7 @@ extern "C" { #endif /* Forward declarations */ -extern struct zebra_dplane_ctx ctx; +struct zebra_dplane_ctx; extern void lua_pushzebra_dplane_ctx(lua_State *L, const struct zebra_dplane_ctx *ctx); extern void lua_decode_zebra_dplane_ctx(lua_State *L, int idx, diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c index 6469b4926..a7d6c5137 100644 --- a/lib/grammar_sandbox_main.c +++ b/lib/grammar_sandbox_main.c @@ -49,8 +49,8 @@ int main(int argc, char **argv) /* Library inits. */ cmd_init(1); - host.name = strdup("test"); - host.domainname = strdup("testdomainname"); + cmd_hostname_set("test"); + cmd_domainname_set("testdomainname"); vty_init(master, true); lib_cmd_init(); diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index 4a3575ae7..2b0fec1b2 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -941,13 +941,10 @@ static void phase_check(void) if (!IS_UP(gs.special)) break; zlog_info("Phased restart: %s is now up.", gs.special->name); - { - struct daemon *dmn; - for (dmn = gs.daemons; dmn; dmn = dmn->next) { - if (dmn != gs.special) - run_job(&dmn->restart, "start", - gs.start_command, 1, 0); - } + for (dmn = gs.daemons; dmn; dmn = dmn->next) { + if (dmn != gs.special) + run_job(&dmn->restart, "start", + gs.start_command, 1, 0); } gs.phase = PHASE_NONE; THREAD_OFF(gs.t_phase_hanging); diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 286cc0292..758fed728 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1820,7 +1820,7 @@ static struct nexthop *nexthop_set_resolved(afi_t afi, /* Copy labels of the resolved route and the parent resolving to it */ if (policy) { - int i = 0; + int label_num = 0; /* * Don't push the first SID if the corresponding action in the @@ -1828,10 +1828,11 @@ static struct nexthop *nexthop_set_resolved(afi_t afi, */ if (!newhop->nh_label || !newhop->nh_label->num_labels || newhop->nh_label->label[0] == MPLS_LABEL_IMPLICIT_NULL) - i = 1; + label_num = 1; - for (; i < policy->segment_list.label_num; i++) - labels[num_labels++] = policy->segment_list.labels[i]; + for (; label_num < policy->segment_list.label_num; label_num++) + labels[num_labels++] = + policy->segment_list.labels[label_num]; label_type = policy->segment_list.type; } else if (newhop->nh_label) { for (i = 0; i < newhop->nh_label->num_labels; i++) { |