From f1f95dff29a03e1c37df68cafd393f4802b921d4 Mon Sep 17 00:00:00 2001 From: sjlleo Date: Tue, 24 May 2022 21:05:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20route-path=20=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reporter/reporter.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reporter/reporter.go b/reporter/reporter.go index c9c13a5..7513319 100644 --- a/reporter/reporter.go +++ b/reporter/reporter.go @@ -62,15 +62,19 @@ func (r *reporter) generateRouteReportNode(ip string, ipGeoData ipgeo.IPGeoData) rpn.asn = ipGeoData.Asnumber } // 无论最后一跳是否为存在地理位置信息(AnyCast),都应该给予显示 - if ipGeoData.Country == "" || ipGeoData.City == "" || ipGeoData.City == "-" && ip != r.targetIP { + if (ipGeoData.Country == "" || ipGeoData.Country == "LAN Address" || ipGeoData.Country == "-") && ip != r.targetIP { return rpn, errors.New("GeoData Search Failed") } else { if ipGeoData.City == "" { - rpn.geo = []string{ipGeoData.Country, ipGeoData.Country} + rpn.geo = []string{ipGeoData.Country, ipGeoData.Prov} } else { rpn.geo = []string{ipGeoData.Country, ipGeoData.City} } } + if ipGeoData.Asnumber == "" { + rpn.asn = "*" + } + if ipGeoData.Isp == "" { rpn.isp = ipGeoData.Owner } else {