]> The Tcpdump Group git mirrors - libpcap/commitdiff
Handle ARPHRD_NONE, used by some tunnel devices, by mapping to DLT_RAW,
authorguy <guy>
Tue, 24 Jun 2008 06:44:32 +0000 (06:44 +0000)
committerguy <guy>
Tue, 24 Jun 2008 06:44:32 +0000 (06:44 +0000)
as it has a zero-length link-layer header.

pcap-linux.c

index 07025b086a706e180fcdaafb79f50768147f1152..c5477115619abd596992dbd75c2f351b452ca205 100644 (file)
@@ -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;