mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-20 01:00:56 +00:00
Merge branch 'MetaCubeX:Alpha' into Alpha
This commit is contained in:
commit
6c2b938e4a
4 changed files with 20 additions and 2 deletions
|
@ -185,6 +185,10 @@ func addIpv6Cidr(trie *IpCidrTrie, ip net.IP, groupSize int) {
|
|||
}
|
||||
|
||||
for i := 2; i < groupSize; i += 2 {
|
||||
if ip[i] == 0 && ip[i+1] == 0 {
|
||||
node.Mark = true
|
||||
}
|
||||
|
||||
if node.Mark {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -74,6 +74,14 @@ func TestIpv6AddFail(t *testing.T) {
|
|||
assert.IsType(t, new(net.ParseError), err)
|
||||
}
|
||||
|
||||
func TestIpv6SearchSub(t *testing.T) {
|
||||
trie := NewIpCidrTrie()
|
||||
assert.NoError(t, trie.AddIpCidrForString("240e::/18"))
|
||||
|
||||
assert.Equal(t, true, trie.IsContainForString("240e:964:ea02:100:1800::71"))
|
||||
|
||||
}
|
||||
|
||||
func TestIpv6Search(t *testing.T) {
|
||||
trie := NewIpCidrTrie()
|
||||
|
||||
|
|
3
main.go
3
main.go
|
@ -72,11 +72,10 @@ func main() {
|
|||
currentDir, _ := os.Getwd()
|
||||
configFile = filepath.Join(currentDir, configFile)
|
||||
}
|
||||
C.SetConfig(configFile)
|
||||
} else {
|
||||
configFile = filepath.Join(C.Path.HomeDir(), C.Path.Config())
|
||||
C.SetConfig(configFile)
|
||||
}
|
||||
C.SetConfig(configFile)
|
||||
|
||||
if geodataMode {
|
||||
C.GeodataMode = true
|
||||
|
|
|
@ -217,6 +217,13 @@ func (logic *Logic) parsePayload(payload string, parseRule ParseRuleFunc) error
|
|||
return err
|
||||
}
|
||||
|
||||
if rule.ShouldResolveIP() {
|
||||
logic.needIP = true
|
||||
}
|
||||
if rule.ShouldFindProcess() {
|
||||
logic.needProcess = true
|
||||
}
|
||||
|
||||
rules = append(rules, rule)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue