Browse Source

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

Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
pull/790/head
yuhan6665 3 years ago committed by 世界
parent
commit
0f0a424e8c
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
  1. 2
      app/router/condition_geoip.go

2
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) {

Loading…
Cancel
Save