Skip to content

Commit

Permalink
Merge pull request nxtrace#173 from nxtrace/main
Browse files Browse the repository at this point in the history
fix bug: ipv6局域网地址错误显示为INVALID
  • Loading branch information
tsosunchia authored Oct 11, 2023
2 parents 239b1c2 + 8b30ef3 commit 3164acf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ipgeo/ipfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func Filter(ip string) (*IPGeoData, bool) {
default:
}
// 判断是否为v6 且不在2000::/3
if net.ParseIP(ip).To4() == nil && !cidrRangeContains("2000::/3", ip) {
if net.ParseIP(ip).To4() == nil && !cidrRangeContains("2000::/3", ip) && !isFiltered {
asn = ""
whois = "INVALID"
isFiltered = true
Expand Down
2 changes: 1 addition & 1 deletion ipgeo/ipgeo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestXxx(t *testing.T) {
}

func TestFilter(t *testing.T) {
res, err := Filter("::1")
res, err := Filter("fd11::1")
//打印whois信息
fmt.Println(res.Whois)
print(err)
Expand Down

0 comments on commit 3164acf

Please sign in to comment.