diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c index 40a157e..62669a9 100644 --- a/lib/route/route_obj.c +++ b/lib/route/route_obj.c @@ -110,6 +110,9 @@ static int route_clone(struct nl_object *_dst, struct nl_object *_src) if (!(dst->rt_pref_src = nl_addr_clone(src->rt_pref_src))) return -NLE_NOMEM; + /* Will be inc'ed again while adding the nexthops of the source */ + dst->rt_nr_nh = 0; + nl_init_list_head(&dst->rt_nexthops); nl_list_for_each_entry(nh, &src->rt_nexthops, rtnh_list) { new = rtnl_route_nh_clone(nh);