Skip to content

Commit 5e7ecc7

Browse files
committed
Clarify behaviour of NetworksWithin()
in the case where the network being searched is contained within another network.
1 parent 30a393a commit 5e7ecc7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

traverse.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ func (r *Reader) Networks() *Networks {
4343
// in the database which are contained in a given network.
4444
//
4545
// Please note that a MaxMind DB may map IPv4 networks into several locations
46-
// in an IPv6 database. This iterator will iterate over all of these
47-
// locations separately.
46+
// in an IPv6 database. This iterator will iterate over all of these locations
47+
// separately.
48+
//
49+
// If the provided network is contained within a network in the database, the
50+
// iterator will iterate over exactly one network, the containing network.
4851
func (r *Reader) NetworksWithin(network *net.IPNet) *Networks {
4952
ip := network.IP
5053
prefixLength, _ := network.Mask.Size()

0 commit comments

Comments
 (0)