Skip to content

tcpreplay not working on MacOS Mojave 10.14.1 - /dev/bpfX limit hard coded to 10 #550

@jestacio-circle

Description

@jestacio-circle

I am running into an issue where tcpreplay fails with the error "Fatal Error: failed to open device en0: Unable to open /dev/bpfX: Resource busy" when trying to replay a pcap file through my wifi interface (en0)

Looking at https://github.com/appneta/tcpreplay/blob/master/src/common/sendpacket.c#L1056

the maximum bpf device files tried is 10 which is hardcoded as a magic number. Increasing this by doing something like #define BPFDEV_LIMIT 10 and replacing the loop condition and array declaration seems to resolve the issue. An even better approach may be to parameterize that value by defining a new flag.

I am running MacOS Mojave 10.14.1 on a Macbook Pro 15" 2016

The brew installed version of tcpreplay has the same issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions