1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 22:49:01 +00:00

Ignore IPMP interfaces in SIOCGLIFCONF intf_loop.

This is a (hopefully temporary) workaround for these virtual interfaces
on Solaris. They don't work for Nmap because they don't allow packet
sniffing, but you can use one of the physical interfaces they're
composed of.
This commit is contained in:
david
2012-05-24 02:56:08 +00:00
parent 35d54e2db6
commit ae2f887af1
2 changed files with 46 additions and 0 deletions

View File

@@ -1030,3 +1030,33 @@ Index: src/eth-bsd.c
if (e->fd != -1 || errno != EBUSY)
break;
}
o Ignored Solaris IPMP interfaces.
diff --git src/intf.c src/intf.c
index 9f4ba19..25ae999 100644
--- src/intf.c
+++ src/intf.c
@@ -941,6 +941,22 @@ intf_loop(intf_t *intf, intf_handler callback, void *arg)
/* Repair the alias name back up */
if (p) *p = ':';
+
+ /* Ignore IPMP interfaces. These are virtual interfaces made up
+ * of physical interfaces. IPMP interfaces do not support things
+ * like packet sniffing; it is necessary to use one of the
+ * underlying physical interfaces instead. This works as long as
+ * the physical interface's test address is on the same subnet
+ * as the IPMP interface's address. */
+ if (ioctl(intf->fd, SIOCGLIFFLAGS, lifr) >= 0)
+ ;
+ else if (intf->fd6 != -1 && ioctl(intf->fd6, SIOCGLIFFLAGS, lifr) >= 0)
+ ;
+ else
+ return (-1);
+ if (lifr->lifr_flags & IFF_IPMP) {
+ continue;
+ }
if (_intf_get_noalias(intf, entry) < 0)
return (-1);

View File

@@ -941,6 +941,22 @@ intf_loop(intf_t *intf, intf_handler callback, void *arg)
/* Repair the alias name back up */
if (p) *p = ':';
/* Ignore IPMP interfaces. These are virtual interfaces made up
* of physical interfaces. IPMP interfaces do not support things
* like packet sniffing; it is necessary to use one of the
* underlying physical interfaces instead. This works as long as
* the physical interface's test address is on the same subnet
* as the IPMP interface's address. */
if (ioctl(intf->fd, SIOCGLIFFLAGS, lifr) >= 0)
;
else if (intf->fd6 != -1 && ioctl(intf->fd6, SIOCGLIFFLAGS, lifr) >= 0)
;
else
return (-1);
if (lifr->lifr_flags & IFF_IPMP) {
continue;
}
if (_intf_get_noalias(intf, entry) < 0)
return (-1);