Add MAC address include/exclude filtering for nftables auto-redirect

Support filtering traffic by source MAC address in the prerouting chain,
using ether addr payload matching with set lookups for multiple addresses.
This commit is contained in:
世界 2026-03-03 20:36:23 +08:00
parent 30e535973b
commit f8e7794cc2
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 146 additions and 0 deletions

2
tun.go
View file

@ -102,6 +102,8 @@ type Options struct {
IncludeAndroidUser []int
IncludePackage []string
ExcludePackage []string
IncludeMACAddress []net.HardwareAddr
ExcludeMACAddress []net.HardwareAddr
InterfaceFinder control.InterfaceFinder
InterfaceMonitor DefaultInterfaceMonitor
FileDescriptor int