aboutsummaryrefslogtreecommitdiff
path: root/pcap-dlpi.c
diff options
context:
space:
mode:
authorguy <guy>2008-04-10 00:50:34 +0000
committerguy <guy>2008-04-10 00:50:34 +0000
commit65f9878991616e9374cd29709265a470cfb895f5 (patch)
treedde673d6b5959c543aa2fe6d93dfc51ae66dbcbb /pcap-dlpi.c
parent8dc3233229b228dff1a42c494b98e620dea14b33 (diff)
Catch another place where you could get told "no, you may not open that
device" and arrange that PCAP_ERROR_PERM_DENIED be returned.
Diffstat (limited to 'pcap-dlpi.c')
-rw-r--r--pcap-dlpi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pcap-dlpi.c b/pcap-dlpi.c
index 0e892637..ba1b1fbe 100644
--- a/pcap-dlpi.c
+++ b/pcap-dlpi.c
@@ -70,7 +70,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.125 2008-04-09 22:02:44 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.126 2008-04-10 00:50:34 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -445,6 +445,8 @@ pcap_activate_dlpi(pcap_t *p)
/* Try device without unit number */
if ((p->fd = open(dname, O_RDWR)) < 0) {
if (errno != ENOENT) {
+ if (errno == EACCES)
+ status = PCAP_ERROR_PERM_DENIED;
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "%s: %s", dname,
pcap_strerror(errno));
goto bad;