Browse Source

Fix: use sorted cidr list (#1156) (#773)

Co-authored-by: Loyalsoldier <[email protected]>
yuhan6665 4 years ago
parent
commit
0f0a424e8c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/router/condition_geoip.go

+ 1 - 1
app/router/condition_geoip.go

@@ -58,7 +58,7 @@ func (m *GeoIPMatcher) Init(cidrs []*CIDR) error {
 	m.ip6 = make([]ipv6, 0, ip6Count)
 	m.prefix6 = make([]uint8, 0, ip6Count)
 
-	for _, cidr := range cidrs {
+	for _, cidr := range cidrList {
 		ip := cidr.Ip
 		prefix := uint8(cidr.Prefix)
 		switch len(ip) {