diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 7d33c89a396a..48fdab6a8475 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -322,11 +322,13 @@ dump_iface(struct nl_writer *nw, if_t ifp, const struct nlmsghdr *hdr, */ if (if_getaddrlen(ifp) != 0) { struct ifaddr *ifa; + struct ifa_iter it; NET_EPOCH_ENTER(et); - ifa = CK_STAILQ_FIRST(&ifp->if_addrhead); + ifa = ifa_iter_start(ifp, &it); if (ifa != NULL) dump_sa(nw, IFLA_ADDRESS, ifa->ifa_addr); + ifa_iter_finish(&it); NET_EPOCH_EXIT(et); }