auto-redirect: Add route address set support for nftables

This commit is contained in:
世界 2024-06-12 02:37:51 +08:00
parent 85fe25a592
commit 85f5f2dd58
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
14 changed files with 1255 additions and 426 deletions

View file

@ -242,6 +242,9 @@ func configure(tunFd int, ifIndex int, name string, options Options) error {
if options.AutoRoute {
var routeRanges []netip.Prefix
routeRanges, err = options.BuildAutoRouteRanges(false)
if err != nil {
return err
}
for _, routeRange := range routeRanges {
if routeRange.Addr().Is4() {
err = addRoute(routeRange, options.Inet4Address[0].Addr())