if (iface) {
/* look for locally addressable target first */
if (interface_ip_find_addr_target(iface, addr, v6))
- goto done;
+ return iface;
/* do not stop at the first route, let the lookup compare
* masks to find the best match */
vlist_for_each_element(&interfaces, iface, node) {
/* look for locally addressable target first */
if (interface_ip_find_addr_target(iface, addr, v6))
- goto done;
+ return iface;
/* do not stop at the first route, let the lookup compare
* masks to find the best match */
}
}
-done:
if (!r_next) {
free(route);
return NULL;