mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Fall back to using the interface address if get_srcaddr fails.
Since r24413, we have tried "connecting" a UDP socket and using getsockname in order to infer our source address. This replaced previous behavior of always using the interface address. However, this appears to fail when scnning certain *.0 addresses on Windows XP. So fall back to the old behavior. http://seclists.org/nmap-dev/2012/q2/464
This commit is contained in:
parent
f1d230b491
commit
18faddcc96
1 changed files with 3 additions and 3 deletions
|
|
@ -3293,7 +3293,7 @@ static int route_dst_generic(const struct sockaddr_storage *dst,
|
|||
/* But the source address we want to use is the target address. */
|
||||
if (!spoofss) {
|
||||
if (get_srcaddr(dst, &rnfo->srcaddr) == -1)
|
||||
return 0;
|
||||
rnfo->srcaddr = ifaces[i].addr;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
@ -3318,7 +3318,7 @@ static int route_dst_generic(const struct sockaddr_storage *dst,
|
|||
sockaddr_equal(&routes[i].gw, dst));
|
||||
if (!spoofss) {
|
||||
if (get_srcaddr(dst, &rnfo->srcaddr) == -1)
|
||||
return 0;
|
||||
rnfo->srcaddr = ifaces[i].addr;
|
||||
}
|
||||
rnfo->nexthop = routes[i].gw;
|
||||
|
||||
|
|
@ -3336,7 +3336,7 @@ static int route_dst_generic(const struct sockaddr_storage *dst,
|
|||
rnfo->direct_connect = 1;
|
||||
if (!spoofss) {
|
||||
if (get_srcaddr(dst, &rnfo->srcaddr) == -1)
|
||||
return 0;
|
||||
rnfo->srcaddr = ifaces[i].addr;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue