From 0f0a424e8cb85405a780b78f2897023844d76925 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Fri, 22 Oct 2021 00:02:07 -0400 Subject: [PATCH] Fix: use sorted cidr list (#1156) (#773) Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> --- app/router/condition_geoip.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/router/condition_geoip.go b/app/router/condition_geoip.go index 99a591e0..0dabf832 100644 --- a/app/router/condition_geoip.go +++ b/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) {