secdev / scapy

Scapy: the Python-based interactive packet manipulation program & library.
https://scapy.net
GNU General Public License v2.0
10.75k stars 2.03k forks source link

Interface names must start with `tun` or `tap` on BSD and Darwin #4049

Open mbUSC opened 1 year ago

mbUSC commented 1 year ago

Brief description

The tun interfaces on my Mac are all named "utun0", "utun1", etc. How can I make scapy work with that?

Scapy version

2.5

Python version

3.10

Operating system

MacOS Ventura

Additional environment information

No response

How to reproduce

from scapy.layers.tuntap import TunTapInterface

if __name__ == "__main__":
    t = TunTapInterface("utun3", mode_tun=True)

Actual result

ValueError: Interface names must start with tun or tap on BSD and Darwin

Expected result

No error

Related resources

No response

guedou commented 1 year ago

That’s indeed a bug. Do you feel like submitting a PR?Sent from my iPhoneOn 28 Jun 2023, at 07:38, Matt Bolognani @.***> wrote: Brief description The tun interfaces on my Mac are all named "utun". How can I make scapy work with that? Scapy version 2.5 Python version 3.10 Operating system MacOS Ventura Additional environment information No response How to reproduce from scapy.layers.tuntap import TunTapInterface if name == "main": t = TunTapInterface("utun3", mode_tun=True) Actual result ValueError: Interface names must start with tun or tap on BSD and Darwin Expected result No error Related resources No response

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

mbUSC commented 1 year ago

@guedou I looked at the code today. Unfortunately it's not just a naming issue; the socket type and ioctl are different. I'll give it a try later this summer. Any suggestions are welcome :)

mbUSC commented 1 year ago

Hi @guedou,

Sorry about the radio silence. I got it to work a month ago, but then had a bunch of stuff come up, so I forgot about it.

I opened a draft pull request with the changes that I made.

There is still a lot of work to be done before it can be merged (adding tests, refactoring, etc.). Unfortunately, I have zero time at the moment; I hope that someone can take it over 🙏