From 94be1ea9dce5de8077ef18d6fb1d9183c3f0eace Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 2 Jun 2017 11:45:52 +0800 Subject: [PATCH] Modify type for the raw link layer According to http://www.tcpdump.org/linktypes.html the value is 101 but in reality it is 12 (and on OpenBSD 14). While browsing through the list on OpenBSD the DLT_LOOP is 12 (and not 108). In the long it might make sense to back these values with cgo (and pcap/bpf.h). --- layers/enums.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layers/enums.go b/layers/enums.go index 963f4d8..d251233 100644 --- a/layers/enums.go +++ b/layers/enums.go @@ -88,7 +88,7 @@ const ( type LinkType uint8 const ( - // According to pcap-linktype(7). + // According to pcap-linktype(7) with fixes from pcap/bpf.h LinkTypeNull LinkType = 0 LinkTypeEthernet LinkType = 1 LinkTypeTokenRing LinkType = 6 @@ -97,7 +97,7 @@ const ( LinkTypePPP LinkType = 9 LinkTypeFDDI LinkType = 10 LinkTypeATM_RFC1483 LinkType = 100 - LinkTypeRaw LinkType = 101 + LinkTypeRaw LinkType = 12 LinkTypePPP_HDLC LinkType = 50 LinkTypePPPEthernet LinkType = 51 LinkTypeC_HDLC LinkType = 104