inet_ntop(
AF_INET6,
&attr->mp_nexthop_global,
- buf_a, BUFSIZ));
+ buf_a, sizeof(buf_a)));
else
vty_out(vty, "%s",
inet_ntop(
AF_INET6,
&attr->mp_nexthop_global,
- buf_a, BUFSIZ));
+ buf_a, sizeof(buf_a)));
} else if (attr->mp_nexthop_len
== BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) {
if (json) {
inet_ntop(AF_INET6,
&attr->mp_nexthop_global,
- buf_a, BUFSIZ);
+ buf_a, sizeof(buf_a));
inet_ntop(AF_INET6,
&attr->mp_nexthop_local,
- buf_b, BUFSIZ);
+ buf_b, sizeof(buf_b));
sprintf(buf_c, "%s(%s)", buf_a, buf_b);
json_object_string_add(
json_out,
inet_ntop(
AF_INET6,
&attr->mp_nexthop_global,
- buf_a, BUFSIZ),
+ buf_a, sizeof(buf_a)),
inet_ntop(
AF_INET6,
&attr->mp_nexthop_local,
- buf_b, BUFSIZ));
+ buf_b, sizeof(buf_b)));
}
}
}
/* CLI start ---------------------------------------------------------------- */
static unsigned int cpu_record_hash_key(struct cpu_thread_history *a)
{
- int size = sizeof(&a->func);
+ int size = sizeof(a->func);
return jhash(&a->func, size, 0);
}
bool ret = true;
char errbuf[256];
- if (!regexp && vty->filter) {
- regfree(&vty->include);
- vty->filter = false;
+ if (!regexp) {
+ if (vty->filter) {
+ regfree(&vty->include);
+ vty->filter = false;
+ }
return true;
}
ospf6_lsa_unlock(req);
on->last_ls_req = NULL;
}
- ospf6_lsdb_remove(req,
- on->request_list);
+ if (req)
+ ospf6_lsdb_remove(req,
+ on->request_list);
ospf6_check_nbr_loading(on);
/* fall through */
}
* RPF address from nexthop cache (i.e.
* destination) as PIM nexthop.
*/
- nexthop->type = NEXTHOP_TYPE_IPV4;
+ nexthop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
nexthop->gate.ipv4 =
pnc->rpf.rpf_addr.u.prefix4;
break;
tab_size, addr_str, pim->vrf->name);
return num_ifindex;
}
+ nexthop_tab[num_ifindex].protocol_distance = distance;
+ nexthop_tab[num_ifindex].route_metric = metric;
switch (nexthop_type) {
case NEXTHOP_TYPE_IFINDEX:
nexthop_tab[num_ifindex].ifindex = stream_getl(s);
}
++num_ifindex;
break;
- case NEXTHOP_TYPE_IPV6:
- case NEXTHOP_TYPE_BLACKHOLE:
- /* ignore */
- continue;
+ default:
+ /* do nothing */
+ {
+ char addr_str[INET_ADDRSTRLEN];
+ pim_inet4_dump("<addr?>", addr, addr_str,
+ sizeof(addr_str));
+ zlog_warn(
+ "%s: found non-ifindex nexthop type=%d for address %s(%s)",
+ __PRETTY_FUNCTION__, nexthop_type,
+ addr_str, pim->vrf->name);
+ }
+ break;
}
- nexthop_tab[num_ifindex].protocol_distance = distance;
- nexthop_tab[num_ifindex].route_metric = metric;
}
return num_ifindex;
return CMD_SUCCESS;
}
- XFREE(MTYPE_STATIC_ROUTE, shr->nhvrf_name);
- XFREE(MTYPE_STATIC_ROUTE, shr->vrf_name);
- XFREE(MTYPE_STATIC_ROUTE, shr);
/*
* If a person enters the same line again
* we need to silently accept it
*/
- return CMD_SUCCESS;
+ goto shr_cleanup;
}
- if (!negate)
+ if (!negate) {
listnode_add_sort(static_list, shr);
+ return CMD_SUCCESS;
+ }
+
+shr_cleanup:
+ XFREE(MTYPE_STATIC_ROUTE, shr->nhvrf_name);
+ XFREE(MTYPE_STATIC_ROUTE, shr->vrf_name);
+ XFREE(MTYPE_STATIC_ROUTE, shr);
return CMD_SUCCESS;
}
zlog_debug(
"%u:SVI %s(%u) VNI %u, sending GW MAC %s IP %s del to BGP",
ifp->vrf_id, ifp->name, ifp->ifindex, zvni->vni,
- prefix_mac2str(&(n->emac), NULL, ETHER_ADDR_STRLEN),
+ prefix_mac2str(&(n->emac), buf1, sizeof(buf1)),
ipaddr2str(ip, buf2, sizeof(buf2)));
/* Remove neighbor from BGP. */