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:
@@ -3313,7 +3313,7 @@ static int route_dst_netlink(const struct sockaddr_storage *dst,
|
|||||||
len -= NLMSG_LENGTH(sizeof(*nlmsg));
|
len -= NLMSG_LENGTH(sizeof(*nlmsg));
|
||||||
|
|
||||||
/* See rtnetlink(7). Anything matching this route is actually unroutable. */
|
/* 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)
|
|| rtmsg->rtm_type == RTN_BLACKHOLE || rtmsg->rtm_type == RTN_PROHIBIT)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -3353,6 +3353,11 @@ static int route_dst_netlink(const struct sockaddr_storage *dst,
|
|||||||
|
|
||||||
if (ii != NULL) {
|
if (ii != NULL) {
|
||||||
rnfo->ii = *ii;
|
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;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user