aboutsummaryrefslogtreecommitdiffstats
path: root/pcap
diff options
context:
space:
mode:
authorguy <guy>2008-07-01 08:02:33 +0000
committerguy <guy>2008-07-01 08:02:33 +0000
commit34624f128f2e6f937c04317fdd2c0ae6d8883ad5 (patch)
treedf708730b36c2a96e7ee94c7b926d4d5bf4d6e64 /pcap
parenta8e63c60ed4d25d27c890ecab14e1a831dbeb198 (diff)
When activating a device, return PCAP_ERROR_IFACE_NOT_UP if the device
isn't up, so applications can report that differently from a generic error (the latter could mean there's a bug somewhere in libpcap). When capturing on a device without mmap on Linux, ignore ENETDOWN, so that we can continue to capture traffic if the interface goes down and comes back up again; comments in the kernel indicate that we'll just block waiting for packets if we try to receive from a socket that delivered ENETDOWN, and, if we're using a memory-mapped buffer, we won't even get notified of "network down" events.
Diffstat (limited to 'pcap')
-rw-r--r--pcap/pcap.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcap/pcap.h b/pcap/pcap.h
index c7bc8a0..2175308 100644
--- a/pcap/pcap.h
+++ b/pcap/pcap.h
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: /tcpdump/master/libpcap/pcap/pcap.h,v 1.13 2008-05-30 01:35:33 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/pcap.h,v 1.14 2008-07-01 08:02:33 guy Exp $ (LBL)
*/
#ifndef lib_pcap_pcap_h
@@ -243,6 +243,7 @@ typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *,
#define PCAP_ERROR_RFMON_NOTSUP -6 /* this device doesn't support rfmon (monitor) mode */
#define PCAP_ERROR_NOT_RFMON -7 /* operation supported only in monitor mode */
#define PCAP_ERROR_PERM_DENIED -8 /* no permission to open the device */
+#define PCAP_ERROR_IFACE_NOT_UP -9 /* interface isn't up */
/*
* Warning codes for the pcap API.