1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-05 06:09:00 +00:00
Files
nmap/libnetutil/netutil.cc
david 66bd9d1993 Enforce device name only after choosing loopback in route_dst_generic.
Nping calls route_dst at least twice: once with a NULL device, and again
with the device learned from the first time. This interfered with the
code that automatically chooses a loopback interface for dests that are
the same as an interface address. For example, if you are 192.168.0.1,
and you are scanning 192.168.0.1, route_dst will tell you to use
interface "lo0" even though the interface of 192.168.0.1 may be "eth0".
route_dst was returning failure because the device name check was being
done before "eth0" got changed to "lo0".

This problem didn't show up on Linux because Linux uses
route_dst_netlink, which delegates the work to the kernel. But I could
reproduce on Linux by forcing the use of route_dst_generic.
2013-02-09 18:55:46 +00:00

151 KiB