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

Ignore RTN_UNSPEC, possible with -e and -S. Fixes #2955

This commit is contained in:
dmiller
2025-10-14 18:43:59 +00:00
parent fcf6f0cb19
commit 3a39ec6d9b

View File

@@ -3313,7 +3313,7 @@ static int route_dst_netlink(const struct sockaddr_storage *dst,
len -= NLMSG_LENGTH(sizeof(*nlmsg));
/* See rtnetlink(7). Anything matching this route is actually unroutable. */
if (rtmsg->rtm_type == RTN_UNREACHABLE || rtmsg->rtm_type == RTN_UNSPEC
if (rtmsg->rtm_type == RTN_UNREACHABLE
|| rtmsg->rtm_type == RTN_BLACKHOLE || rtmsg->rtm_type == RTN_PROHIBIT)
return 0;
@@ -3353,6 +3353,11 @@ static int route_dst_netlink(const struct sockaddr_storage *dst,
if (ii != NULL) {
rnfo->ii = *ii;
if (rnfo->srcaddr.ss_family == AF_UNSPEC) {
assert(!spoofss);
assert(rnfo->ii.addr.ss_family == dst->ss_family);
rnfo->srcaddr = rnfo->ii.addr;
}
return 1;
} else {
return 0;