]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd ripd ripngd: variable shadowing fixes
authorF. Aragon <paco@voltanet.io>
Wed, 12 Sep 2018 10:55:31 +0000 (12:55 +0200)
committerF. Aragon <paco@voltanet.io>
Wed, 12 Sep 2018 10:55:31 +0000 (12:55 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
pimd/mtracebis_netlink.c
pimd/pim_ifchannel.c
pimd/pim_pim.c
ripd/rip_interface.c
ripd/ripd.c
ripngd/ripngd.c

index 30ee8f24abd7fb26a165818a84a6999ff5ed21ab..47b5f7e52c0a0c275dbcc581531d8b30152e1668 100644 (file)
@@ -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,
index 3137345037061ec78adebaf04f067956443d1269..a3d6a2e658cd4cc4a718eb8c1390f8d201a8e26a 100644 (file)
@@ -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",
index d5ee30fb2e018c67de578b65501e85caa47a8a12..cf078064d8ac8497afe513e0ec9056127c54102b 100644 (file)
@@ -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, dst_str, sizeof(dst_str));
                zlog_debug("%s: to %s on %s: msg_size=%d checksum=%x",
index 364e23c5e63b6d92b492c8c7039b7e89d12b3b3e..5b50c031a671ab67738b31248c7259443ab0fcc5 100644 (file)
@@ -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;
                        }
                }
index 02ead6fde2d56a279f8249f54088206d7ecc0020..560e649a89244caccad49b3d5490abdbc3e1512f 100644 (file)
@@ -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);
index d1341d67b7493713f2ea231b0145f1b38f335f18..850216b44b57efd6007dd7a58b9f1c09a946b3e6 100644 (file)
@@ -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