summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_route.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2020-11-20 04:00:31 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2020-11-30 15:36:10 +0100
commit1fa58587355b61793bfaeb7c295d4d1292aaa4f7 (patch)
treefad39b5095773e860a3538a8630b5d6a8b64afa7 /ospf6d/ospf6_route.c
parentospf6: get instance from lsdb data (diff)
downloadfrr-1fa58587355b61793bfaeb7c295d4d1292aaa4f7.tar.xz
frr-1fa58587355b61793bfaeb7c295d4d1292aaa4f7.zip
ospf6: fix crash on shutdown
The crash is sometimes reproduced by all_protocol_startup topotest. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospf6d/ospf6_route.c')
-rw-r--r--ospf6d/ospf6_route.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 09b012e5a..60c208437 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -292,28 +292,28 @@ void ospf6_add_nexthop(struct list *nh_list, int ifindex, struct in6_addr *addr)
void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route,
struct zapi_nexthop nexthops[],
- int entries)
+ int entries, vrf_id_t vrf_id)
{
struct ospf6_nexthop *nh;
struct listnode *node;
- struct interface *ifp;
char buf[64];
int i;
if (route) {
i = 0;
for (ALL_LIST_ELEMENTS_RO(route->nh_list, node, nh)) {
- ifp = if_lookup_by_index_all_vrf(nh->ifindex);
if (IS_OSPF6_DEBUG_ZEBRA(SEND)) {
+ const char *ifname;
inet_ntop(AF_INET6, &nh->address, buf,
sizeof(buf));
+ ifname = ifindex2ifname(nh->ifindex, vrf_id);
zlog_debug(" nexthop: %s%%%.*s(%d)", buf,
- IFNAMSIZ, ifp->name, nh->ifindex);
+ IFNAMSIZ, ifname, nh->ifindex);
}
if (i >= entries)
return;
- nexthops[i].vrf_id = ifp->vrf_id;
+ nexthops[i].vrf_id = vrf_id;
nexthops[i].ifindex = nh->ifindex;
if (!IN6_IS_ADDR_UNSPECIFIED(&nh->address)) {
nexthops[i].gate.ipv6 = nh->address;