1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-19 05:59:01 +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:
david
2010-02-28 19:45:39 +00:00
parent 2e99f41bfd
commit d9fd52c194
3 changed files with 60 additions and 1 deletions

View File

@@ -113,6 +113,20 @@ eth_match_ppa(eth_t *e, const char *device)
}
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 @@ eth_open(const char *device)
#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));
}