Closed josemic closed 10 years ago
Might be due to tcp checksum offloading. You can try disabling it:
ethtool --show-offload <dev>
ethtool --offload rx off
ethtool --offload tx off
<...>
Is the packet in your wireshark screenshot the same one in your example? The checksums seem to be different.
On another topic: I added a new version of decapsulate/1 to pkt: pkt/decode/1,2. I will push it in a bit.
decapsulate/1 will now crash on any error. Use it when you only care about valid packets. You can catch the crash:
Packet = try pkt:decapsulate(Frame)
catch
error:_ -> invalid_packet
end
decode/1,2 looks like:
case pkt:decode(Frame) of % can also specify the protocol pkt:decode(tcp, Frame)
{ok, [#ether{}, #ipv4{}, #tcp{}, Payload]} ->
Payload;
{error, [#ether{}, #ipv4{}], {tcp, Data} = Failed} ->
...
This should deal with truncated packets using the snaplen option or malformed packets. Sound ok?
sudo ethtool -K eth0 tx-checksum-ip4 off
sudo ethtool -K eth0 tso off
Thanks for the link!
I have the case that wireshark and pkt calculate (the identical) checksum error, but my linux pc acknowledges the packet. Thus either wireshark and pkt have both the same error, pcap has an error or my Linux-PC does not calculate the TCP checksum before acknowledging the packet.
The pcap file is available upon request. Any ideas?