Files
amnezia-tun2socks/core/route.go
albexk 9fabebb17e Modifications for libxray (#2)
* Rename module and move to awg
2024-06-18 14:37:09 +01:00

26 lines
492 B
Go

package core
import (
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"github.com/amnezia-vpn/amnezia-tun2socks/v2/core/option"
)
func withRouteTable(nicID tcpip.NICID) option.Option {
return func(s *stack.Stack) error {
s.SetRouteTable([]tcpip.Route{
{
Destination: header.IPv4EmptySubnet,
NIC: nicID,
},
{
Destination: header.IPv6EmptySubnet,
NIC: nicID,
},
})
return nil
}
}