nexthop->family = in->family;
nexthop->gw = in->gw;
- r = set_ensure_allocated(nexthops, &nexthop_hash_ops);
- if (r < 0)
- return r;
-
- r = set_put(*nexthops, nexthop);
+ r = set_ensure_put(nexthops, &nexthop_hash_ops, nexthop);
if (r < 0)
return r;
if (r == 0)
return r;
} else if (r == 0) {
/* Take over a foreign nexthop */
- r = set_ensure_allocated(&link->nexthops, &nexthop_hash_ops);
- if (r < 0)
- return r;
-
- r = set_put(link->nexthops, nexthop);
+ r = set_ensure_put(&link->nexthops, &nexthop_hash_ops, nexthop);
if (r < 0)
return r;