Skip to content

[Bug] tcpreplay exits after the 1st packet send failure #751

@idogoshen

Description

@idogoshen

Description
tcpreplay exits after the 1st packet send failure and does not continue replaying the next packets
this is a behavior change from former versions that used to count the failure but continue replaying

To Reproduce
replay pcap with 3 packets in which the 2nd packet is too long and cannot be sent
pkt_too_long.pcap.gz

tcpreplay -i eth0 -t pkt_too_long.pcap
Warning in interface.c:get_interface_list() line 93:
May need to run as root to get access to all network interfaces.
Warning in send_packets.c:send_packets() line 486:
Unable to send packet: Error with PF_PACKET send() [2]: Message too long (errno = 90)
Actual: 1 packets (105 bytes) sent in 0.000060 seconds
Rated: 1750000.0 Bps, 14.00 Mbps, 16666.66 pps
Flows: 2 flows, 33333.33 fps, 2 flow packets, 0 non-flow
Statistics for network device: eth0
Successful packets: 1
Failed packets: 1
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0

Expected behavior
2 successful packet
Successful packets: 2
Failed packets: 1

System :
OS: Ubuntu 22.04.1

tcpreplay -V
Warning in interface.c:get_interface_list() line 93:
May need to run as root to get access to all network interfaces.
tcpreplay version: 4.3.4 (build git:v4.3.4) (debug)
Copyright 2013-2018 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.10.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: disabled
Injection method: PF_PACKET send()
Not compiled with netmap

Additional context
It used to work in 4.2.6

cgs@u18c_g5b9:~$ tcpreplay -V 2>&1 | grep version
tcpreplay version: 4.2.6 (build git:v4.2.6)

cgs@u18c_g5b9:~$ tcpreplay -i eth0 -t pkt_too_long.pcap
Warning in interface.c:get_interface_list() line 94:
May need to run as root to get access to all network interfaces.
Warning in send_packets.c:send_packets() line 637:
Unable to send packet: Error with PF_PACKET send() [2]: Message too long (errno = 90)
Actual: 3 packets (3004 bytes) sent in 0.000157 seconds
Rated: 19133757.9 Bps, 153.07 Mbps, 19108.28 pps
Flows: 2 flows, 12738.85 fps, 3 flow packets, 0 non-flow
Statistics for network device: eth0
Successful packets: 2
Failed packets: 1
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0

Looks like it broke by adding break on each sendpacket failure
8ce5ff6#diff-9090d8b99ade533bb5645fa56979270c7af557bd23ad6b323a809057d1b1a0e3R645
That seem to required some tuning on what error to break or if to continue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions