]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf6d: listhead returns a listnode *
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 17 Apr 2019 03:15:56 +0000 (23:15 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 17 Apr 2019 03:15:56 +0000 (23:15 -0400)
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 <sharpd@cumulusnetworks.com>
ospf6d/ospf6_route.c

index b71b353e1f7feb5029295f9dca82074c0e5ce068..441a6f36778d0f94f128bd1b7c0375d0d6b53d73 100644 (file)
@@ -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);