Fix broadcast addrs for nets smaller than /8
This commit is contained in:
@@ -124,7 +124,7 @@ func bcast(ip *net.IPNet) *net.IPNet {
|
||||
|
||||
offset := len(bc.IP) - len(bc.Mask)
|
||||
for i := range bc.IP {
|
||||
if i-offset > 0 {
|
||||
if i-offset >= 0 {
|
||||
bc.IP[i] = ip.IP[i] | ^ip.Mask[i-offset]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user