Skip to content

[Bug] tcprewrite fails with "From tcpedit.c:tcpedit_packet() line 192: Packet length 98 is to short to contain an IPv6 header for DLT 0x0001" #611

@yp-isi

Description

@yp-isi

Describe the bug
TCP rewrite fails to parse input pcap file, exits with the error:

Fatal Error: Error rewriting packets: From tcpedit.c:tcpedit_packet() line 192:
Packet length 98 is to short to contain an IPv6 header for DLT 0x0001

To Reproduce
Steps to reproduce the behavior:

  1. Run tcprewrite as follows:
tcprewrite -vv -i afail1.pcap -o /dev/null --pnat="9.9.0.0/16:1.1.0.0/16"
  1. Observe the output:
reading from file -, link-type EN10MB (Ethernet)
17:11:17.1592871077 IP6 4950:3aa3:964b:a356:60a3:7dea:a836:3200 > 4efa:695:ee19:12d9:4906:6f8b:8bbb:6bd6: frag (0|36) 63927 > domain: 0 [0q] (28)

Fatal Error: Error rewriting packets: From tcpedit.c:tcpedit_packet() line 192:
Packet length 98 is to short to contain an IPv6 header for DLT 0x0001

Expected behavior
Not to fail. Even if the packet is not parse-able, it should either (a) drop it, (b) overwrite IPs, but not checksum, (c) leave such packets as is.

Screenshots
N/A

System (please complete the following information):

  • OS: linux
  • OS fedora 31
  • Tcpreplay Version
tcpreplay version: 4.3.2 (build git:v4.3.2)
Copyright 2013-2018 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Compiled against libdnet: 1.12
Compiled against libpcap: 1.9.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: enabled
Injection method: PF_PACKET send()
Not compiled with netmap

Additional context
Failed pcap attached.
afail1.pcap.gz

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions