diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-03-25 06:04:54 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-03-25 06:04:54 +0000 |
commit | 2fecf91a175d91f3c2d0a202cb0acd9a94068b40 (patch) | |
tree | 700f673f6b8d6150dc0cc7798d1e6bb9477d1f0f /pcap-util.c | |
parent | cb0461411d1e5c0b9b934cc7de8c59d52774f9eb (diff) |
AIX's BPF, and thus its tcpdump, appears to use 24 as the link-layer
type for loopback devices; map it to DLT_NULL when reading libpcap files
with a major version of 2 and a minor version of 2, and when capturing
from an "loN" device on AIX.
svn path=/trunk/; revision=7361
Diffstat (limited to 'pcap-util.c')
-rw-r--r-- | pcap-util.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pcap-util.c b/pcap-util.c index 4f44078060..655301d23b 100644 --- a/pcap-util.c +++ b/pcap-util.c @@ -1,7 +1,7 @@ /* pcap-util.c * Utility routines for packet capture * - * $Id: pcap-util.c,v 1.10 2002/08/28 21:00:40 jmayer Exp $ + * $Id: pcap-util.c,v 1.11 2003/03/25 06:04:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -100,6 +100,8 @@ get_pcap_linktype(pcap_t *pch, char *devname * Token Ring 9 * FDDI 15 * + * and the ifType value for a loopback device is 24. + * * The AIX names for LAN devices begin with: * * Ethernet en @@ -107,6 +109,8 @@ get_pcap_linktype(pcap_t *pch, char *devname * Token Ring tr * FDDI fi * + * and the AIX names for loopback devices begin with "lo". + * * (The difference between "Ethernet" and "802.3" is presumably * whether packets have an Ethernet header, with a packet type, * or an 802.3 header, with a packet length, followed by an 802.2 @@ -174,6 +178,15 @@ get_pcap_linktype(pcap_t *pch, char *devname */ linktype = 10; } + } else if (strncmp(ifacename, "lo") == 0) { + if (linktype == 24) { + /* + * That's the RFC 1573 value for "software loopback" + * devices; map it to DLT_NULL, which is what's used + * for loopback devices on BSD. + */ + linktype = 0; + } } #endif |