Skip to content

Commit

Permalink
fix: when give ipv4 cidr ipv6 gateway, the gateway will extend infini…
Browse files Browse the repository at this point in the history
…tely (#3860)

Signed-off-by: Changlu Yi <[email protected]>
  • Loading branch information
changluyi authored Mar 25, 2024
1 parent 5770668 commit 55c314e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func checkAndUpdateGateway(subnet *kubeovnv1.Subnet) (bool, error) {
switch {
case subnet.Spec.Gateway == "":
gw, err = util.GetGwByCidr(subnet.Spec.CIDRBlock)
case util.CheckProtocol(subnet.Spec.Gateway) != util.CheckProtocol(subnet.Spec.CIDRBlock):
case subnet.Spec.Protocol == kubeovnv1.ProtocolDual && util.CheckProtocol(subnet.Spec.Gateway) != util.CheckProtocol(subnet.Spec.CIDRBlock):
gw, err = util.AppendGwByCidr(subnet.Spec.Gateway, subnet.Spec.CIDRBlock)
default:
gw = subnet.Spec.Gateway
Expand Down

0 comments on commit 55c314e

Please sign in to comment.