From 1019731833f2f5a5b6b28d0909df4895cc388398 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 16 Apr 2019 23:15:56 -0400 Subject: [PATCH] ospf6d: listhead returns a listnode * The ospf6_route_get_first_nh_index function call calls listhead which returns a (listnode *) but we are casting it to a (struct ospf6_nexthop *) and away we go. Fixes: #4142 Found By: Kwind Signed-off-by: Donald Sharp --- ospf6d/ospf6_route.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index b71b353e1f..441a6f3677 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -331,8 +331,9 @@ int ospf6_route_get_first_nh_index(struct ospf6_route *route) struct ospf6_nexthop *nh; if (route) { - if ((nh = (struct ospf6_nexthop *)listhead(route->nh_list))) - return (nh->ifindex); + nh = listnode_head(route->nh_list); + if (nh) + return nh->ifindex; } return (-1);