mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Only handle addresses of the own ip family
This commit is contained in:
parent
a69b565c3e
commit
5065f89a17
@ -1679,7 +1679,12 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre
|
|||||||
|
|
||||||
func (proxier *Proxier) getLegacyBindAddr(activeBindAddrs map[string]bool, currentBindAddrs []string) map[string]bool {
|
func (proxier *Proxier) getLegacyBindAddr(activeBindAddrs map[string]bool, currentBindAddrs []string) map[string]bool {
|
||||||
legacyAddrs := make(map[string]bool)
|
legacyAddrs := make(map[string]bool)
|
||||||
|
isIpv6 := utilnet.IsIPv6(proxier.nodeIP)
|
||||||
for _, addr := range currentBindAddrs {
|
for _, addr := range currentBindAddrs {
|
||||||
|
addrIsIpv6 := utilnet.IsIPv6(net.ParseIP(addr))
|
||||||
|
if addrIsIpv6 && !isIpv6 || !addrIsIpv6 && isIpv6 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if _, ok := activeBindAddrs[addr]; !ok {
|
if _, ok := activeBindAddrs[addr]; !ok {
|
||||||
legacyAddrs[addr] = true
|
legacyAddrs[addr] = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user