aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-11-25 12:02:06 -0800
committerGuy Harris <guy@alum.mit.edu>2009-11-25 12:02:06 -0800
commitb8c57c9529c273496b6ce6a144770c0cf9de392d (patch)
tree6552570d009f0aa3bb5a5a3af1e05ea056337470
parent272bbe3dfed640aa5fcb5075ad4abede8882141f (diff)
Don't check for DLT_IPNET if it's not defined - in pcap-bpf.c, the bpf.h
we're using is the OS's, not libpcap's, so it's not necessarily defined. Explain why we're checking for DLT_IPNET.
-rw-r--r--pcap-bpf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/pcap-bpf.c b/pcap-bpf.c
index 3cb91de..383845b 100644
--- a/pcap-bpf.c
+++ b/pcap-bpf.c
@@ -539,12 +539,20 @@ get_dlt_list(int fd, int v, struct bpf_dltlist *bdlp, char *ebuf)
* right thing to do, but I suspect it is - Ethernet <->
* 802.11 bridges would probably badly mishandle frames
* that don't have Ethernet headers).
+ *
+ * On Solaris with BPF, Ethernet devices also offer
+ * DLT_IPNET, so we, if DLT_IPNET is defined, we don't
+ * treat it as an indication that the device isn't an
+ * Ethernet.
*/
if (v == DLT_EN10MB) {
is_ethernet = 1;
for (i = 0; i < bdlp->bfl_len; i++) {
- if (bdlp->bfl_list[i] != DLT_EN10MB &&
- bdlp->bfl_list[i] != DLT_IPNET) {
+ if (bdlp->bfl_list[i] != DLT_EN10MB
+#ifdef DLT_IPNET
+ && bdlp->bfl_list[i] != DLT_IPNET
+#endif
+ ) {
is_ethernet = 0;
break;
}