aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguy <guy>2008-06-24 06:44:32 +0000
committerguy <guy>2008-06-24 06:44:32 +0000
commitae8f708268e9ac5ab3f54da20b395236573f3d00 (patch)
tree82b906d175987bb0dab0c32180e5c88d2ca11400
parentff0b6ac4a09c7e03f1f86f1369ee2b27b734ac0b (diff)
Handle ARPHRD_NONE, used by some tunnel devices, by mapping to DLT_RAW,
as it has a zero-length link-layer header.
-rw-r--r--pcap-linux.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index 07025b08..c5477115 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.148 2008-04-14 21:04:51 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.149 2008-06-24 06:44:32 guy Exp $ (LBL)";
#endif
/*
@@ -1539,6 +1539,17 @@ static void map_arphrd_to_dlt(pcap_t *handle, int arptype, int cooked_ok)
handle->linktype = DLT_LINUX_LAPD;
break;
+#ifndef ARPHRD_NONE
+#define ARPHRD_NONE 0xFFFE
+#endif
+ case ARPHRD_NONE:
+ /*
+ * No link-layer header; packets are just IP
+ * packets, so use DLT_RAW.
+ */
+ handle->linktype = DLT_RAW;
+ break;
+
default:
handle->linktype = -1;
break;