From dc7204b77579fc5667c330a8917eb55e1829f2c9 Mon Sep 17 00:00:00 2001 From: "F. Aragon" Date: Wed, 12 Sep 2018 12:55:31 +0200 Subject: [PATCH] pimd ripd ripngd: variable shadowing fixes Signed-off-by: F. Aragon --- pimd/mtracebis_netlink.c | 8 ++++---- pimd/pim_ifchannel.c | 3 ++- pimd/pim_pim.c | 2 -- ripd/rip_interface.c | 10 +++++----- ripd/ripd.c | 2 -- ripngd/ripngd.c | 7 ------- 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/pimd/mtracebis_netlink.c b/pimd/mtracebis_netlink.c index 30ee8f24abd7..47b5f7e52c0a 100644 --- a/pimd/mtracebis_netlink.c +++ b/pimd/mtracebis_netlink.c @@ -243,7 +243,7 @@ int rtnl_dump_filter_l(struct rtnl_handle *rth, break; /* process next filter */ } if (h->nlmsg_type == NLMSG_ERROR) { - struct nlmsgerr *err = + struct nlmsgerr *merr = (struct nlmsgerr *)NLMSG_DATA( h); if (h->nlmsg_len @@ -252,7 +252,7 @@ int rtnl_dump_filter_l(struct rtnl_handle *rth, fprintf(stderr, "ERROR truncated\n"); } else { - errno = -err->error; + errno = -merr->error; perror("RTNETLINK answers"); } return -1; @@ -379,12 +379,12 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer, } if (h->nlmsg_type == NLMSG_ERROR) { - struct nlmsgerr *err = + struct nlmsgerr *merr = (struct nlmsgerr *)NLMSG_DATA(h); if (l < (int)sizeof(struct nlmsgerr)) { fprintf(stderr, "ERROR truncated\n"); } else { - errno = -err->error; + errno = -merr->error; if (errno == 0) { if (answer) memcpy(answer, h, diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 313734503706..a3d6a2e658cd 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -1115,7 +1115,8 @@ void pim_ifchannel_local_membership_del(struct interface *ifp, struct channel_oil *c_oil = child->channel_oil; struct pim_ifchannel *chchannel = pim_ifchannel_find(ifp, &child->sg); - struct pim_interface *pim_ifp = ifp->info; + + pim_ifp = ifp->info; if (PIM_DEBUG_EVENTS) zlog_debug("%s %s: Prune(S,G)=%s(%s) from %s", diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index d5ee30fb2e01..cf078064d8ac 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -573,8 +573,6 @@ int pim_msg_send(int fd, struct in_addr src, struct in_addr dst, ip->ip_len = htons(sendlen); if (PIM_DEBUG_PIM_PACKETS) { - struct pim_msg_header *header = - (struct pim_msg_header *)pim_msg; char dst_str[INET_ADDRSTRLEN]; pim_inet4_dump("", dst, dst_str, sizeof(dst_str)); zlog_debug("%s: to %s on %s: msg_size=%d checksum=%x", diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 364e23c5e63b..5b50c031a671 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -712,7 +712,7 @@ static int rip_enable_network_lookup_if(struct interface *ifp) for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, connected)) { struct prefix *p; - struct route_node *node; + struct route_node *n; p = connected->address; @@ -721,10 +721,10 @@ static int rip_enable_network_lookup_if(struct interface *ifp) address.prefix = p->u.prefix4; address.prefixlen = IPV4_MAX_BITLEN; - node = route_node_match(rip_enable_network, - (struct prefix *)&address); - if (node) { - route_unlock_node(node); + n = route_node_match(rip_enable_network, + (struct prefix *)&address); + if (n) { + route_unlock_node(n); return 1; } } diff --git a/ripd/ripd.c b/ripd/ripd.c index 02ead6fde2d5..560e649a8924 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -436,8 +436,6 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from, /* Modify entry according to the interface routemap. */ if (ri->routemap[RIP_FILTER_IN]) { - int ret; - /* The object should be of the type of rip_info */ ret = route_map_apply(ri->routemap[RIP_FILTER_IN], (struct prefix *)&p, RMAP_RIP, &newinfo); diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index d1341d67b749..850216b44b57 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -706,8 +706,6 @@ static void ripng_route_process(struct rte *rte, struct sockaddr_in6 *from, /* Modify entry. */ if (ri->routemap[RIPNG_FILTER_IN]) { - int ret; - ret = route_map_apply(ri->routemap[RIPNG_FILTER_IN], (struct prefix *)&p, RMAP_RIPNG, &newinfo); @@ -1618,8 +1616,6 @@ void ripng_output_process(struct interface *ifp, struct sockaddr_in6 *to, /* Interface route-map */ if (ri->routemap[RIPNG_FILTER_OUT]) { - int ret; - ret = route_map_apply( ri->routemap[RIPNG_FILTER_OUT], (struct prefix *)p, RMAP_RIPNG, rinfo); @@ -1636,8 +1632,6 @@ void ripng_output_process(struct interface *ifp, struct sockaddr_in6 *to, /* Redistribute route-map. */ if (ripng->route_map[rinfo->type].name) { - int ret; - ret = route_map_apply( ripng->route_map[rinfo->type].map, (struct prefix *)p, RMAP_RIPNG, rinfo); @@ -1724,7 +1718,6 @@ void ripng_output_process(struct interface *ifp, struct sockaddr_in6 *to, /* Interface route-map */ if (ri->routemap[RIPNG_FILTER_OUT]) { - int ret; struct ripng_info newinfo; /* let's cast the aggregate structure to