Skip to content

Commit d205873

Browse files
committed
Ensure address is always network address
Signed-off-by: Pawloland <59684145+Pawloland@users.noreply.github.com>
1 parent 50c81bb commit d205873

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libtailscale/ranges_calc/ranges_calc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func (s space) rangeToCIDRs(r ipRange) []netip.Prefix {
111111
// prefixToRange converts a netip.Prefix to an ipRange with Start and End addresses.
112112
// Start is the network address and End is the broadcast address.
113113
func (s space) prefixToRange(p netip.Prefix) ipRange {
114+
p = p.Masked()
114115
start := s.addrToInt(p.Addr())
115116
hostBits := int(s.bits) - p.Bits()
116117
size := new(big.Int).Lsh(big.NewInt(1), uint(hostBits))

0 commit comments

Comments
 (0)