Skip to content
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

[Bug] tcprewrite on Linux Cooked Capture hits fatal error in edit_packet.c:fix_ipv4_checksums() #792

Open
msi3na opened this issue Mar 3, 2023 · 4 comments

Comments

@msi3na
Copy link

msi3na commented Mar 3, 2023

Trying tcprewrite to remove Linux Cooked Capture, but it hits a fatal error with an apparently well formed TCP packet over IP (all checksums are correct). Output is an empty pcap.

Command
tcprewrite --dlt=enet -i test_1.pcap -o test_2.pcap

Error
Fatal Error: Error rewriting packets: From edit_packet.c:fix_ipv4_checksums() line 75:
Invalid packet: Expected IPv4 packet: got 0: pkt=1

Attachments
Archive 3.zip

Tried on both versions below:

-- MAC OS homebrew
tcprewrite version: 4.4.3 (build git:v4.4.3)
Copyright 2013-2022 by Fred Klassen - AppNeta
Copyright 2000-2012 by Aaron Turner
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Compiled against libdnet: 1.14
Compiled against libpcap: 1.10.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Fragroute engine: enabled

-- Ubuntu 20.4 LTS
tcprewrite version: 4.4.1 (build git:v4.4.1)
Copyright 2013-2022 by Fred Klassen - AppNeta
Copyright 2000-2012 by Aaron Turner
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.9.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Fragroute engine: disabled

image

@bastienvty
Copy link

I have the same problem with raw ip packets. Did you find something @msi3na ?

@fklassen
Copy link
Member

SLL is not currently supported. This is a feature, not a bug. We are targeting SLL for 4.5, and probably will include PR #728

@btriller
Copy link

Actually the input pcap does not have SLL2 dlt. Is has SLL dlt, which is supported. Using version 4.3.3 from Debian correctly rewrites provided pcap. It seems 6fc5930 introduced this regression. In my tests, L3 proto isn't copied to ethernet header and L3 data points two bytes before original L3 data.

@fklassen
Copy link
Member

Thanks for clarifying. Will reopen and target next release.

@fklassen fklassen reopened this Jun 12, 2023
@fklassen fklassen assigned fklassen and unassigned fklassen Sep 4, 2023
@fklassen fklassen added enhancement shelved Will not be addressed in foreseeable future and removed enhancement shelved Will not be addressed in foreseeable future labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants