mirror of
https://github.com/ntop/n2n.git
synced 2026-10-20 08:18:05 +00:00
The tuntaposx kernel extension is no longer supported on modern macOS (Catalina+, Apple Silicon, Tahoe). This replaces it with native utun interfaces, adding an L2/L3 translation shim so the n2n wire protocol remains 100% Ethernet-compatible with Linux/Windows TAP peers. New files: - macos/utun.c: utun socket lifecycle (PF_SYSTEM, CTLIOCGINFO, connect) - macos/arp.c: internal ARP cache/responder for L2 emulation - macos/route.c: macOS route table management - tools/tests-utun.c: 24 unit tests for translation shim and ARP cache - scripts/test_utun.sh: integration test suite Key changes: - src/tuntap_osx.c: complete rewrite with Ethernet header synthesis (tuntap_read) and stripping (tuntap_write), ARP interception - src/edge.c: enable signal handlers and N2N_CAN_NAME_IFACE for macOS - src/n2n.c: add SO_REUSEPORT for multicast socket (fixes multi-edge) - include/n2n_typedefs.h: add edge_context back-pointer for ARP replies - doc/Building.md: updated macOS instructions (no kexts required) Tested: macOS Tahoe (Darwin 25.x, ARM64) <-> Ubuntu Linux TAP edge via shared supernode with bidirectional ping confirmed.