Closed SharerMax closed 4 years ago
Sorry.
type hostsLine struct {
domain string
ip net.IP
ipv6 bool
}
when execute parseLine
function, ipv6
has been set. so if ip is ipv4 the ipv6
is false
and if ip is ipv6 the ipv6
is true
.
I think domain
and ipv6
indicate one unique host record. so we can compare domain
and ipv6
to determine host reocrd whether exist or not exist.
Merged. It seems work, I will check it when I have enough time. Thanks!
Thanks for your PR! Please explain the idea of your code in few words. I'm a little bit confused. In my point of view, I think the "check existing" and "add" method must be reimplemented to support ipv4 and ipv6 at the same time...