1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 08:29:04 +00:00

Don't fatal when failing to find an interface by index.

This commit is contained in:
david
2011-08-30 19:19:34 +00:00
parent 43422f9344
commit 44e5b39fa2

View File

@@ -3130,8 +3130,11 @@ static int route_dst_generic(const struct sockaddr_storage *dst,
assert(it != NULL);
entry.intf_len = sizeof(entry);
rc = intf_get_index(it, &entry, sin6->sin6_family, sin6->sin6_scope_id);
if (rc == -1)
netutil_fatal("Could not find interface with index %u", (unsigned int) sin6->sin6_scope_id);
if (rc == -1) {
intf_close(it);
netutil_error("Could not find interface with index %u", (unsigned int) sin6->sin6_scope_id);
return 0;
}
intf_close(it);
Strncpy(namebuf, entry.intf_name, sizeof(namebuf));