Skip to content

Unable to decode LinkType 20 #1198

@HaibaraAi119

Description

@HaibaraAi119

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions