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

@ -6,6 +6,7 @@ import (
"crypto/x509"
"fmt"
"net"
"net/netip"
"os"
"strconv"
"sync"
@ -318,7 +319,7 @@ func ReCreateMixed(port int, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.P
log.Infoln("Mixed(http+socks) proxy listening at: %s", mixedListener.Address())
}
func ReCreateTun(tunConf *config.Tun, tunAddressPrefix string, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.PacketAdapter) {
func ReCreateTun(tunConf *config.Tun, tunAddressPrefix *netip.Prefix, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.PacketAdapter) {
tunMux.Lock()
defer tunMux.Unlock()