]> The Tcpdump Group git mirrors - libpcap/commitdiff
The Linux 2.4 kernel supplies ARPHRD_IEEE802_TR, rather than
authorguy <guy>
Sun, 3 Dec 2000 09:07:27 +0000 (09:07 +0000)
committerguy <guy>
Sun, 3 Dec 2000 09:07:27 +0000 (09:07 +0000)
ARPHRD_IEEE802, as the hardware type for Token Ring interfaces.  Map
both of them to DLT_IEEE802 (as that has become the DLT_ type for Token
Ring, the fact that it just says "802", not "802_5" or whatever,
nonwithstanding), and, if ARPHRD_IEEE802_TR isn't defined, define it
with the value it has in 2.4 (so that the resulting libpcap will work on
a 2.4 system regardless of whether the system on which it was built
defined ARPHRD_IEEE802_TR).

pcap-linux.c

index 927cbf574f2b8f7ecd3576179262f3d2000c5222..59e570746c02847ba40c2bac5770fbc78ea139ba 100644 (file)
@@ -26,7 +26,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.40 2000-11-04 07:19:23 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.41 2000-12-03 09:07:27 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -516,6 +516,10 @@ static int map_arphrd_to_dlt(int arptype)
        case ARPHRD_AX25:       return DLT_AX25;
        case ARPHRD_PRONET:     return DLT_PRONET;
        case ARPHRD_CHAOS:      return DLT_CHAOS;
+#ifndef ARPHRD_IEEE802_TR
+#define ARPHRD_IEEE802_TR 800  /* From Linux 2.4 */
+#endif
+       case ARPHRD_IEEE802_TR:
        case ARPHRD_IEEE802:    return DLT_IEEE802;
        case ARPHRD_ARCNET:     return DLT_ARCNET;
        case ARPHRD_FDDI:       return DLT_FDDI;