mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 10:01:30 +00:00
Fix private ip will never be matched
This commit is contained in:
parent
140ed9a4cb
commit
e766f25d55
|
@ -63,11 +63,10 @@ func (r *GeoIPItem) Match(metadata *adapter.InboundContext) bool {
|
||||||
func (r *GeoIPItem) match(metadata *adapter.InboundContext, destination netip.Addr) bool {
|
func (r *GeoIPItem) match(metadata *adapter.InboundContext, destination netip.Addr) bool {
|
||||||
var geoipCode string
|
var geoipCode string
|
||||||
geoReader := r.router.GeoIPReader()
|
geoReader := r.router.GeoIPReader()
|
||||||
if geoReader != nil {
|
if !N.IsPublicAddr(destination) {
|
||||||
geoipCode = geoReader.Lookup(destination)
|
|
||||||
}
|
|
||||||
if geoipCode == "" && !N.IsPublicAddr(destination) {
|
|
||||||
geoipCode = "private"
|
geoipCode = "private"
|
||||||
|
} else if geoReader != nil {
|
||||||
|
geoipCode = geoReader.Lookup(destination)
|
||||||
}
|
}
|
||||||
if geoipCode == "" {
|
if geoipCode == "" {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue