Replacing interface tap by feth couple of interfaces on macOS
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.6k
- Forks
- 3.4k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm actually trying to change openvpn code in order to keep tap behavior without using actual tap interfaces on macOS clients. This relies on a couple of native feth interfaces. Different approaches are possible:
- Using bpf interface for reading local packets and sending tunnel traffic to the interface through a socket
- Using bpf interface for reading local packets and sending tunnel traffic through the same bpf interface
- Creating a RW socket for the interface management in both directions.
For the moment, I'm working on the first one. This is what people suggest everytime somebody is talking about mac tap interfaces... The main issue is that bpf interface can put multiple packets into buffer during the same read action. I'm still looking for a simple solution to solve this. It is easy to get the first packet, the point is how to preserve remaining data until the next iteration of the tunnel_point_to_point loop. Probably with a secondary buffer and an additional TUN_READ_REMAIN status flag...
On the other hand, I wonder why the second approach is not suggested (all BPF)... What could be the issue with packet injections through the bpf?
Finally, the third approach seems to be more complex to implement, as actual socket management is related to c2 context and it will be necessary to get some socket functions widely visible.
What do you think?
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests; start by tracing the macOS interface handling around the tunnel_point_to_point loop and the TUN_READ_REMAIN status flag. Review the BPF, feth, and c2 socket-management approaches described in the issue, but the desired implementation and completion criteria still need maintainer agreement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, macos
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100