Skip to content

Commit

Permalink
pimd ripd ripngd: variable shadowing fixes
Browse files Browse the repository at this point in the history
Signed-off-by: F. Aragon <paco@voltanet.io>
  • Loading branch information
F. Aragon committed Sep 12, 2018
1 parent 88f47ef commit dc7204b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
8 changes: 4 additions & 4 deletions pimd/mtracebis_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion pimd/pim_ifchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions pimd/pim_pim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions ripd/rip_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
}
Expand Down
2 changes: 0 additions & 2 deletions ripd/ripd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions ripngd/ripngd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dc7204b

Please sign in to comment.