We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73b17fb commit e03a5a2Copy full SHA for e03a5a2
internal/testutil/fixture/fixture.go
@@ -79,7 +79,8 @@ func (f *Fixture) RandomIPv4Prefixes(n int) []netip.Prefix {
79
)
80
81
for _, ip := range ips {
82
- bits := int(f.RandomUint64(24)) + 8
+ const MinBits = 16
83
+ bits := int(f.RandomUint64(32-MinBits)) + MinBits
84
p, err := ip.Prefix(bits)
85
if err != nil {
86
panic("unreachable: it should always be a valid IP prefix")
@@ -118,7 +119,8 @@ func (f *Fixture) RandomIPv6Prefixes(n int) []netip.Prefix {
118
119
120
121
- bits := int(f.RandomUint64(120)) + 8
122
+ const MinBits = 32
123
+ bits := int(f.RandomUint64(128-MinBits)) + MinBits
124
125
126
0 commit comments