aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-linux.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-07-30 20:58:08 -0700
committerGuy Harris <guy@alum.mit.edu>2009-07-30 20:58:08 -0700
commitefeaba4650832a911665b0876c007258da79d54b (patch)
tree1d745ecc6bff48f73189607e6c40343ea2f10998 /pcap-linux.c
parent0101db9e7cb221615f8165d9f3dee26c13e4f7d0 (diff)
The pcap_activate() man page says:
If PCAP_WARNING_PROMISC_NOTSUP, PCAP_ERROR_NO_SUCH_DEVICE, or PCAP_ERROR_PERM_DENIED is returned, pcap_geterr() or pcap_perror() may be called with p as an argument to fetch or display an message giving additional details about the problem that might be useful for debugging the problem if it's unexpected. but we weren't always setting the error string in question. Do so. In pcap_open_live(), if the open fails with PCAP_ERROR, include the device name in the error string, and if it fails with PCAP_ERROR_NO_SUCH_DEVICE or PCAP_ERROR_PERM_DENIED, include the device name and both error messages in the error string.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r--pcap-linux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index d5460ec..eebc3e0 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -880,6 +880,8 @@ pcap_can_set_rfmon_linux(pcap_t *handle)
}
if (errno == ENODEV) {
/* The device doesn't even exist. */
+ (void)snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
+ "SIOCGIWMODE failed: %s", pcap_strerror(errno));
close(sock_fd);
return PCAP_ERROR_NO_SUCH_DEVICE;
}