fix default fake ip filter
This commit is contained in:
2 files changed
+3
-25
No files matched your search
@@ -36,9 +36,9 @@ func init() {
|
||||
EnhancedMode: dns.FAKEIP,
|
||||
FakeIPRange: "198.18.0.0/16",
|
||||
FakeIPFilter: []string{ // default fake-ip filters for stun services
|
||||
".stun.*.*",
|
||||
".stun.*.*.*",
|
||||
".stun.*.*.*.*",
|
||||
"+.stun.*.*",
|
||||
"+.stun.*.*.*",
|
||||
"+.stun.*.*.*.*",
|
||||
},
|
||||
DefaultNameserver: defaultNameServers,
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ func StartTunDevice(fd, mtu int, gateway, mirror, dnsAddress string, onStop func
|
||||
file := os.NewFile(uintptr(fd), "/dev/tun")
|
||||
_ = syscall.SetNonblock(fd, true)
|
||||
|
||||
increaseMaxConnection()
|
||||
|
||||
adapter = tun2socket.NewTun2Socket(file, mtu, gatewayIP, mirrorIP.To4())
|
||||
|
||||
adapter.SetLogger(&ClashLogger{})
|
||||
@@ -135,23 +133,3 @@ func StopTunDevice() {
|
||||
log.Infoln("Android tun stopped")
|
||||
}
|
||||
}
|
||||
|
||||
func increaseMaxConnection() {
|
||||
var limit syscall.Rlimit
|
||||
|
||||
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if limit.Max == limit.Cur {
|
||||
return
|
||||
}
|
||||
|
||||
limit.Cur = limit.Max
|
||||
|
||||
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
log.Infoln("Increase max connection to %d", limit.Cur)
|
||||
}
|
||||
Reference in new issue
Block a user