mirror of
https://github.com/nmap/nmap.git
synced 2026-01-04 13:49:03 +00:00
Upgrade libpcap to 1.10.4
This commit is contained in:
@@ -139,6 +139,9 @@ pcap_read_snit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
|
||||
|
||||
/*
|
||||
* loop through each snapshot in the chunk
|
||||
*
|
||||
* This assumes that a single buffer of packets will have
|
||||
* <= INT_MAX packets, so the packet count doesn't overflow.
|
||||
*/
|
||||
n = 0;
|
||||
ep = bp + cc;
|
||||
@@ -331,12 +334,16 @@ pcap_activate_snit(pcap_t *p)
|
||||
if (fd < 0 && errno == EACCES)
|
||||
p->fd = fd = open(dev, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
if (errno == EACCES)
|
||||
if (errno == EACCES) {
|
||||
err = PCAP_ERROR_PERM_DENIED;
|
||||
else
|
||||
snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
|
||||
"Attempt to open %s failed with EACCES - root privileges may be required",
|
||||
dev);
|
||||
} else {
|
||||
err = PCAP_ERROR;
|
||||
pcap_fmt_errmsg_for_errno(p->errbuf, PCAP_ERRBUF_SIZE,
|
||||
errno, "%s", dev);
|
||||
pcap_fmt_errmsg_for_errno(p->errbuf, PCAP_ERRBUF_SIZE,
|
||||
errno, "%s", dev);
|
||||
}
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user