sec_list = json_object_new_array();
for (ALL_LIST_ELEMENTS_RO(pim_ifp->sec_addr_list, sec_node, sec_addr)) {
json_object_array_add(sec_list,
- json_object_new_string(prefix2str(&sec_addr->addr, pbuf, PREFIX2STR_BUFFER)));
+ json_object_new_string(prefix2str(&sec_addr->addr,
+ pbuf,
+ sizeof(pbuf))));
}
json_object_object_add(json_row, "secondaryAddressList", sec_list);
}
inet_ntoa(ifaddr), VTY_NEWLINE);
for (ALL_LIST_ELEMENTS_RO(pim_ifp->sec_addr_list, sec_node, sec_addr)) {
vty_out(vty, " %s%s",
- prefix2str(&sec_addr->addr, pbuf, PREFIX2STR_BUFFER), VTY_NEWLINE);
+ prefix2str(&sec_addr->addr,
+ pbuf,
+ sizeof(pbuf)), VTY_NEWLINE);
}
} else {
vty_out(vty, "Address : %s%s", inet_ntoa(ifaddr), VTY_NEWLINE);
neigh_src_str, sizeof(neigh_src_str));
for (ALL_LIST_ELEMENTS_RO(neigh->prefix_list, prefix_node, p)) {
- char neigh_sec_str[100];
+ char neigh_sec_str[PREFIX2STR_BUFFER];
- prefix2str(p, neigh_sec_str, 100);
+ prefix2str(p, neigh_sec_str, sizeof(neigh_sec_str));
vty_out(vty, "%-9s %-15s %-15s %-15s%s",
ifp->name,
p->family = AF_INET6;
p->prefixlen = IPV6_MAX_PREFIXLEN;
- memcpy(&p->u.prefix6, addr, 16);
+ memcpy(&p->u.prefix6, addr, sizeof(struct in6_addr));
addr += sizeof(struct in6_addr);
break;
break;
case NEXTHOP_TYPE_IPV6_IFINDEX:
nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET6;
- stream_get (&nexthop_tab[num_ifindex].nexthop_addr.u.prefix6, s, 16);
+ stream_get (&nexthop_tab[num_ifindex].nexthop_addr.u.prefix6,
+ s,
+ sizeof(struct in6_addr));
nexthop_tab[num_ifindex].ifindex = stream_getl (s);
p.family = AF_INET6;
p.prefixlen = IPV6_MAX_PREFIXLEN;
- memcpy (&p.u.prefix6, &nexthop_tab[num_ifindex].nexthop_addr.u.prefix6, 16);
+ memcpy (&p.u.prefix6,
+ &nexthop_tab[num_ifindex].nexthop_addr.u.prefix6,
+ sizeof(struct in6_addr));
/*
* If we are sending v6 secondary assume we receive v6 secondary