mirror of
https://github.com/nmap/nmap.git
synced 2025-12-21 15:09:02 +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:
@@ -1030,3 +1030,33 @@ Index: src/eth-bsd.c
|
|||||||
if (e->fd != -1 || errno != EBUSY)
|
if (e->fd != -1 || errno != EBUSY)
|
||||||
break;
|
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);
|
||||||
|
|||||||
@@ -942,6 +942,22 @@ intf_loop(intf_t *intf, intf_handler callback, void *arg)
|
|||||||
/* Repair the alias name back up */
|
/* Repair the alias name back up */
|
||||||
if (p) *p = ':';
|
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)
|
if (_intf_get_noalias(intf, entry) < 0)
|
||||||
return (-1);
|
return (-1);
|
||||||
if (_intf_get_aliases(intf, entry) < 0)
|
if (_intf_get_aliases(intf, entry) < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user