Refactor: fakeip pool use netip.Prefix, supports ipv6 range

This commit is contained in:
yaling888
2022-04-12 00:31:04 +08:00
parent 5999b6262d
commit 008ee613ab
11 changed files with 254 additions and 179 deletions

View File

@ -189,9 +189,9 @@ func updateRules(rules []C.Rule) {
}
func updateTun(tun *config.Tun, dns *config.DNS) {
var tunAddressPrefix string
var tunAddressPrefix *netip.Prefix
if dns.FakeIPRange != nil {
tunAddressPrefix = dns.FakeIPRange.IPNet().String()
tunAddressPrefix = dns.FakeIPRange.IPNet()
}
P.ReCreateTun(tun, tunAddressPrefix, tunnel.TCPIn(), tunnel.UDPIn())