Closed juanmalaver closed 3 years ago
Hi, can you try the following?
Change writer, err := mmdbwriter.Load("GeoIP2-Country.mmdb", mmdbwriter.Options{})
to writer, err := mmdbwriter.Load("GeoIP2-Country.mmdb", mmdbwriter.Options{IncludeReservedNetworks: true})
?
See https://pkg.go.dev/github.com/maxmind/mmdbwriter#Options:~:text=%2F%2F%20IncludeReservedNetworks%20will%20allow%20reserved%20networks,IncludeReservedNetworks%20bool for why I think this may work for you.
It work perfectly, thanks for the link !!
I am using the sample code as a reference to add specific ipv4 address to my mmdb file. For every ip i am using i keep getting a similar error to the following one
2021/03/26 06:33:41 attempt to insert ::a00:0/106, which is in a reserved network
sonmething particular about this error is that is showing an ipv6 format in the error
`package main
import ( "log" "net" "os"
)
func main() { // Load the database we wish to enrich. writer, err := mmdbwriter.Load("GeoIP2-Country.mmdb", mmdbwriter.Options{}) if err != nil { log.Fatal(err) }
`
this is also happening with other ip address like 172.16.0.0 and so on