Skip to content

Commit 6552035

Browse files
committed
Validated the IPv4 to IPv6 mapping.
1 parent 6158bfc commit 6552035

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ func (r *Reader) Netmask(ipAddress net.IP) (uint, error) {
236236
// Record is empty
237237
return 0, nil
238238
} else if node > nodeCount {
239+
if r.Metadata.IPVersion == 6 && ipAddress.To4() != nil {
240+
return i - 96, nil
241+
}
239242
return i, nil
240243
}
241244

0 commit comments

Comments
 (0)