File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,11 @@ func (r *Reader) LookupOffset(ip net.IP) (uintptr, error) {
167
167
func (r * Reader ) cidr (ip net.IP , prefixLength int ) * net.IPNet {
168
168
// This is necessary as the node that the IPv4 start is at may
169
169
// be at a bit depth that is less that 96, i.e., ipv4Start points
170
- // to a leaf node.
170
+ // to a leaf node. For instance, if a record was inserted at ::/8,
171
+ // the ipv4Start would point directly at the leaf node for the
172
+ // record and would have a bit depth of 8. This would not happen
173
+ // with databases currently distributed by MaxMind as all of them
174
+ // have an IPv4 subtree that is greater than a single node.
171
175
if r .Metadata .IPVersion == 6 &&
172
176
len (ip ) == net .IPv4len &&
173
177
r .ipv4StartBitDepth != 96 {
You can’t perform that action at this time.
0 commit comments