Skip to content

tcpreplay fails to open already allocated tap0 device #411

@rmstoi

Description

@rmstoi

Hi,

I've been using tcpreplay with the Zephyr Project RTOS
https://github.com/zephyrproject-rtos/zephyr

tcpreplay version 4, provided from the package repositories (Debian, Ubuntu, Fedora) does not work anymore with the TAP interface. The last working version is tcpreplay 3.4.4.

The problem is that tun network device allocation (/dev/net/tun) is done by tunslip6.c in Zephyr net-tools before tcpreplay.

https://github.com/zephyrproject-rtos/net-tools/blob/master/tunslip6.c#L720

So when tcpreplay is ran, it tries to also open tun device and reports:

tcpreplay -i tap0 packet.pcapng

Fatal Error in sendpacket.c:sendpacket_open() line 539:
 failed to open device tap0: Unable to create tuntap interface: tap0

I can workaround this by recompiling tcpreplay with:

./configure --disable-tuntap

but it would be nice if tcpreplay from the package repository works.

Maybe tcpreplay could have a command line option to open /dev/net/tun?
Otherwise it would use already opened device.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions