dect
/
libnl
Archived
13
0
Fork 0

route_clone : fix segmentation fault using nl_cache_subset to filter routes

reset the nb nhops to 0 (dst->rt_nr_nh = 0) before setting the dst->nhops
from the src->nhops
This commit is contained in:
Loïc Touraine 2012-08-29 12:14:01 +02:00 committed by Thomas Graf
parent 376a0e29c7
commit 97d2460fab
1 changed files with 3 additions and 0 deletions

View File

@ -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);