]> 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:45:04 +0000 (06:45 +0000)
committerguy <guy>
Tue, 24 Jun 2008 06:45:04 +0000 (06:45 +0000)
as it has a zero-length link-layer header.

pcap-linux.c

index 75f3d16d57fccaa91b399375fd9414ac7288da47..db561367bd2e82bc2d816bb8be37cdd4d7938431 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.129.2.19 2008-04-14 21:05:03 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.129.2.20 2008-06-24 06:45:04 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;