-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
The LinkType type is a uint8:
https://github.com/google/gopacket/blob/master/layers/enums.go#L93
However, the canonical list of linktype numbers currently has a max of 266.
http://www.tcpdump.org/linktypes.html
Additionally, looking at the pcap documentation, it looks like that is returned as an int
http://www.tcpdump.org/manpages/pcap_datalink.3pcap.txt
and when we use that function, we also use an int
https://github.com/google/gopacket/blob/master/pcap/pcap.go#L651
Edit: oh, I see how that works. The layers.LinkType() is casting the int to uint8.
I'm also not sure how to solve this in a fully backwards compatible way, but I figured I should bring it up since I noticed it...