-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to decode LinkType 20 #1198
Comments
Please switch to this. The newer link type with the latest device has been updated, and it is working for me |
I fixed it like this once, it was causing because of linux sll2 packet and afaik this lib doesn't include it. so smth like const sll2HeaderSize = 20
// remove the first 20 bytes that only has sll2 information, unrelated to the packet info.
packetBytes := packet.Data()[sll2HeaderSize:]
// create new packet
packet = gopacket.NewPacket(packetBytes, layers.LayerTypeIPv4, gopacket.Default) |
i'd like to how about its compatibility with old gopacket |
It's the same, just a maintained fork afaik. |
i had tested it today,it's working great !!! |
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
The text was updated successfully, but these errors were encountered: