1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-12 02:39:03 +00:00
Commit Graph

59 Commits

Author SHA1 Message Date
david
62c2276755 Properly match up directly connect routes with alias interface addresses
in getsysroutes_proc. This was already being done for non–directly
connected routes, those with a gateway. Victor Rudnev reported this bug.

The /proc/net/route file doesn't contain alias qualifications so we must
match them up after the fact with the interface table. When the gateway
address isn't set, use the route destination for matching instead.

For example, with these interfaces and routing table,

eth0      Link encap:Ethernet  HWaddr 00:50:BF:16:11:61
          inet addr:192.168.1.21  Bcast:192.168.1.255 Mask:255.255.255.0

eth0:1    Link encap:Ethernet  HWaddr 00:50:BF:16:11:61
          inet addr:192.168.0.21  Bcast:192.168.0.255 Mask:255.255.255.0

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

nmap --iflist before this commit:

DEV    (SHORT) IP/MASK         TYPE     UP MAC
eth0   (eth0)  192.168.1.21/24 ethernet up 00:50:BF:16:11:61
eth0:1 (eth0)  192.168.0.21/24 ethernet up 00:50:BF:16:11:61

DST/MASK       DEV    GATEWAY
192.168.1.0/24 eth0
192.168.0.0/24 eth0

nmap --iflist after this commit:

DEV    (SHORT) IP/MASK         TYPE     UP MAC
eth0   (eth0)  192.168.1.21/24 ethernet up 00:50:BF:16:11:61
eth0:1 (eth0)  192.168.0.21/24 ethernet up 00:50:BF:16:11:61

DST/MASK       DEV    GATEWAY
192.168.1.0/24 eth0
192.168.0.0/24 eth0:1
2010-07-04 17:42:49 +00:00
david
9d1a797c8f Revert r18424. This was mean to fix OpenBSD compilation but it broken on
Windows because of a lack of <sys/socket.h>. We have a request in to the
original reporter for more information and a cleaner fix.
2010-06-30 00:11:07 +00:00
luis
8aa0a4b5fe Fixed compiler warning caused by a possible uninitialized var 2010-06-28 07:47:35 +00:00
luis
c32d0c6d66 Fixed a couple of compiler warnings, caused by signed vs unsigned comparisons 2010-06-28 07:46:00 +00:00
luis
6e0e3964bb Fixed compilation problem in OpenBSD 4.7. This was reported and fixed by Lori 2010-06-28 07:44:28 +00:00
david
0a3c6f1fc7 Include <sys/types.h> before <net/if_arp.h> in netutil.cc. I needed this on OS
X when compiling against the 10.4u SDK.
2010-06-24 15:04:16 +00:00
david
a468082429 Remove DOS line endings from some lines in netutil.cc. 2010-06-24 14:34:33 +00:00
luis
d11edeb3e7 Changed send_frag_ip_packet() to make sure it accepts big MTU values, and fixed the format specifier, which was printing a signed integer when it should print an unsigned one 2010-06-22 18:22:54 +00:00
luis
da126c8b78 Merged nmap-dedup branch from nmap-exp/luis/nmap-dedup. This completes the Nmap/Nping code de-duplication phase. 2010-06-22 17:24:34 +00:00