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 }