From 5eb6f82c1ade7ceac0e9f26283d35ec806e47b9f Mon Sep 17 00:00:00 2001 From: Prince Pereira Date: Fri, 3 Feb 2023 11:14:20 +0530 Subject: [PATCH] [Issue:#115501] Fix for issue with Loadbalancer policy creation for IPV6 endpoints in Dualstack mode. --- pkg/proxy/winkernel/hns.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/proxy/winkernel/hns.go b/pkg/proxy/winkernel/hns.go index db0f835c55a..1f31c94e636 100644 --- a/pkg/proxy/winkernel/hns.go +++ b/pkg/proxy/winkernel/hns.go @@ -112,8 +112,28 @@ func (hns hns) getAllEndpointsByNetwork(networkName string) (map[string]*(endpoi terminating: false, } endpointInfos[ep.IpConfigurations[0].IpAddress] = endpointInfos[ep.Id] + + if len(ep.IpConfigurations) == 1 { + continue + } + + // If ipFamilyPolicy is RequireDualStack or PreferDualStack, then there will be 2 IPS (iPV4 and IPV6) + // in the endpoint list + endpointDualstack := &endpointsInfo{ + ip: ep.IpConfigurations[1].IpAddress, + isLocal: uint32(ep.Flags&hcn.EndpointFlagsRemoteEndpoint) == 0, + macAddress: ep.MacAddress, + hnsID: ep.Id, + hns: hns, + // only ready and not terminating endpoints were added to HNS + ready: true, + serving: true, + terminating: false, + } + endpointInfos[ep.IpConfigurations[1].IpAddress] = endpointDualstack } klog.V(3).InfoS("Queried endpoints from network", "network", networkName) + klog.V(5).InfoS("Queried endpoints details", "network", networkName, "endpointInfos", endpointInfos) return endpointInfos, nil }