mirror of
https://github.com/nmap/nmap.git
synced 2026-01-06 14:39:03 +00:00
Upgrade libpcap to 1.10.4
This commit is contained in:
@@ -267,7 +267,7 @@ pcap_nametonetaddr(const char *name)
|
||||
* *not* always get set if getnetbyname_r() succeeds.
|
||||
*/
|
||||
np = NULL;
|
||||
err = getnetbyname_r(name, &result_buf, buf, sizeof buf, &np,
|
||||
err = getnetbyname_r(name, &result_buf, buf, sizeof buf, &np,
|
||||
&h_errnoval);
|
||||
if (err != 0) {
|
||||
/*
|
||||
@@ -296,16 +296,16 @@ pcap_nametonetaddr(const char *name)
|
||||
else
|
||||
np = &result_buf;
|
||||
#else
|
||||
/*
|
||||
* We don't have any getnetbyname_r(); either we have a
|
||||
* getnetbyname() that uses thread-specific data, in which
|
||||
* case we're thread-safe (sufficiently recent FreeBSD,
|
||||
* sufficiently recent Darwin-based OS, sufficiently recent
|
||||
* HP-UX, sufficiently recent Tru64 UNIX), or we have the
|
||||
* traditional getnetbyname() (everything else, including
|
||||
* current NetBSD and OpenBSD), in which case we're not
|
||||
* thread-safe.
|
||||
*/
|
||||
/*
|
||||
* We don't have any getnetbyname_r(); either we have a
|
||||
* getnetbyname() that uses thread-specific data, in which
|
||||
* case we're thread-safe (sufficiently recent FreeBSD,
|
||||
* sufficiently recent Darwin-based OS, sufficiently recent
|
||||
* HP-UX, sufficiently recent Tru64 UNIX), or we have the
|
||||
* traditional getnetbyname() (everything else, including
|
||||
* current NetBSD and OpenBSD), in which case we're not
|
||||
* thread-safe.
|
||||
*/
|
||||
np = getnetbyname(name);
|
||||
#endif
|
||||
if (np != NULL)
|
||||
@@ -552,16 +552,16 @@ pcap_nametoproto(const char *str)
|
||||
else
|
||||
p = &result_buf;
|
||||
#else
|
||||
/*
|
||||
* We don't have any getprotobyname_r(); either we have a
|
||||
* getprotobyname() that uses thread-specific data, in which
|
||||
* case we're thread-safe (sufficiently recent FreeBSD,
|
||||
* sufficiently recent Darwin-based OS, sufficiently recent
|
||||
* HP-UX, sufficiently recent Tru64 UNIX, Windows), or we have
|
||||
/*
|
||||
* We don't have any getprotobyname_r(); either we have a
|
||||
* getprotobyname() that uses thread-specific data, in which
|
||||
* case we're thread-safe (sufficiently recent FreeBSD,
|
||||
* sufficiently recent Darwin-based OS, sufficiently recent
|
||||
* HP-UX, sufficiently recent Tru64 UNIX, Windows), or we have
|
||||
* the traditional getprotobyname() (everything else, including
|
||||
* current NetBSD and OpenBSD), in which case we're not
|
||||
* thread-safe.
|
||||
*/
|
||||
* current NetBSD and OpenBSD), in which case we're not
|
||||
* thread-safe.
|
||||
*/
|
||||
p = getprotobyname(str);
|
||||
#endif
|
||||
if (p != 0)
|
||||
@@ -785,9 +785,14 @@ pcap_ether_hostton(const char *name)
|
||||
{
|
||||
register u_char *ap;
|
||||
u_char a[6];
|
||||
char namebuf[1024];
|
||||
|
||||
/*
|
||||
* In AIX 7.1 and 7.2: int ether_hostton(char *, struct ether_addr *);
|
||||
*/
|
||||
pcap_strlcpy(namebuf, name, sizeof(namebuf));
|
||||
ap = NULL;
|
||||
if (ether_hostton(name, (struct ether_addr *)a) == 0) {
|
||||
if (ether_hostton(namebuf, (struct ether_addr *)a) == 0) {
|
||||
ap = (u_char *)malloc(6);
|
||||
if (ap != NULL)
|
||||
memcpy((char *)ap, (char *)a, 6);
|
||||
|
||||
Reference in New Issue
Block a user