mirror of
https://github.com/nmap/nmap.git
synced 2025-12-19 14:09:02 +00:00
o Fixed the parsing of libdnet DLPI interface names that contain more
than one string of digits. Joe Dietz reported that an interface with
the name e1000g0 was causing the error message
Warning: Unable to open interface e1000g0 -- skipping it.
on Solaris 9. [David]
This commit is contained in:
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
[NOT YET RELEASED]
|
[NOT YET RELEASED]
|
||||||
|
|
||||||
|
o Fixed the parsing of libdnet DLPI interface names that contain more
|
||||||
|
than one string of digits. Joe Dietz reported that an interface with
|
||||||
|
the name e1000g0 was causing the error message
|
||||||
|
Warning: Unable to open interface e1000g0 -- skipping it.
|
||||||
|
on Solaris 9. [David]
|
||||||
|
|
||||||
o [NSE] Raw packet sending at the IP layer is now supported, in addition to
|
o [NSE] Raw packet sending at the IP layer is now supported, in addition to
|
||||||
the Ethernet sending functionality. Packets to send start with an IPv4
|
the Ethernet sending functionality. Packets to send start with an IPv4
|
||||||
header and can be sent to arbitrary hosts. [Kris]
|
header and can be sent to arbitrary hosts. [Kris]
|
||||||
|
|||||||
@@ -214,6 +214,45 @@ Index: libdnet-stripped/src/intf-win32.c
|
|||||||
} else
|
} else
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
|
Changed the PPA extraction from DLPI interface names to use the last
|
||||||
|
string of digits, not the first. It was being fooled by the name
|
||||||
|
e1000g0, thinking the PPA was 1000.
|
||||||
|
|
||||||
|
Index: src/eth-dlpi.c
|
||||||
|
===================================================================
|
||||||
|
--- src/eth-dlpi.c (revision 16878)
|
||||||
|
+++ src/eth-dlpi.c (working copy)
|
||||||
|
@@ -113,6 +113,20 @@
|
||||||
|
}
|
||||||
|
return (ppa);
|
||||||
|
}
|
||||||
|
+#else
|
||||||
|
+static int
|
||||||
|
+dev_find_ppa(const char *dev)
|
||||||
|
+{
|
||||||
|
+ const char *p;
|
||||||
|
+
|
||||||
|
+ p = dev + strlen(dev);
|
||||||
|
+ while (p > dev && strchr("0123456789", *(p - 1)) != NULL)
|
||||||
|
+ p--;
|
||||||
|
+ if (*p == '\0')
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ return p;
|
||||||
|
+}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
eth_t *
|
||||||
|
@@ -138,7 +152,7 @@
|
||||||
|
#else
|
||||||
|
e->fd = -1;
|
||||||
|
snprintf(dev, sizeof(dev), "/dev/%s", device);
|
||||||
|
- if ((p = strpbrk(dev, "0123456789")) == NULL) {
|
||||||
|
+ if ((p = dev_find_ppa(dev)) == NULL) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return (eth_close(e));
|
||||||
|
}
|
||||||
|
|
||||||
===CHANGES ALREADY MERGED TO UPSTREAM LIBDNET GO BELOW THIS LINE===
|
===CHANGES ALREADY MERGED TO UPSTREAM LIBDNET GO BELOW THIS LINE===
|
||||||
o Made some code changes to intf.c (the patch below). This does the following:
|
o Made some code changes to intf.c (the patch below). This does the following:
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,20 @@ eth_match_ppa(eth_t *e, const char *device)
|
|||||||
}
|
}
|
||||||
return (ppa);
|
return (ppa);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static int
|
||||||
|
dev_find_ppa(const char *dev)
|
||||||
|
{
|
||||||
|
const char *p;
|
||||||
|
|
||||||
|
p = dev + strlen(dev);
|
||||||
|
while (p > dev && strchr("0123456789", *(p - 1)) != NULL)
|
||||||
|
p--;
|
||||||
|
if (*p == '\0')
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eth_t *
|
eth_t *
|
||||||
@@ -138,7 +152,7 @@ eth_open(const char *device)
|
|||||||
#else
|
#else
|
||||||
e->fd = -1;
|
e->fd = -1;
|
||||||
snprintf(dev, sizeof(dev), "/dev/%s", device);
|
snprintf(dev, sizeof(dev), "/dev/%s", device);
|
||||||
if ((p = strpbrk(dev, "0123456789")) == NULL) {
|
if ((p = dev_find_ppa(dev)) == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (eth_close(e));
|
return (eth_close(e));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user