Skip to content

Commit

Permalink
Fix maximum subnetport number in a subnet (vmware-tanzu#783)
Browse files Browse the repository at this point in the history
Signed-off-by: Yanjun Zhou <[email protected]>
  • Loading branch information
yanjunz97 authored Sep 27, 2024
1 parent 6202688 commit eaaad7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controllers/common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func AllocateSubnetFromSubnetSet(subnetSet *v1alpha1.SubnetSet, vpcService servi
// totalIP will be overrided if IpAddresses are specified.
totalIP, _ = util.CalculateIPFromCIDRs(nsxSubnet.IpAddresses)
}
if portNums < totalIP-3 {
// NSX reserves 4 ip addresses in each subnet for network address, gateway address,
// dhcp server address and broadcast address.
if portNums < totalIP-4 {
return *nsxSubnet.Path, nil
}
}
Expand Down

0 comments on commit eaaad7c

Please sign in to comment.