/* 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);
}
* 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. */