google / google/gopacket

Unable to decode LinkType 20

Open
#1,198 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

i use tcpdump to get a tcp package,and then save a cap file,
but i use gopacket parsing this cap file,following error occurs:
"Packet decoding error: Unable to decode LinkType 20"

my code:
handle, err = pcap.OpenOffline(capFile)

packetSource := gopacket.NewPacketSource(handle, handle.LinkType())
//go print_counter()
for packet := range packetSource.Packets() {
fmt.Println(packet) //**Packet decoding error: Unable to decode LinkType 20**
printPacketInfo(packet)
}

... ...

tcpLayer := packet.Layer(layers.LayerTypeTCP) //**Causes an error here ,is null**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.