Skip to content

Commit

Permalink
chore: don't remove the network address and broadcast address
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Mar 16, 2024
1 parent 82e1f6e commit 3ecd486
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func GetAddressCount(network *net.IPNet) uint64 {
}
}

// Subtract the network address and broadcast address (2) from the total number of addresses.
return 1<<(uint64(bits)-uint64(prefixLen)) - 2
return 1 << (uint64(bits) - uint64(prefixLen))
}

// ContainsAddress checks if the given IP network contains the specified IP address.
Expand Down

0 comments on commit 3ecd486

Please sign in to comment.