mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Updates after review
This commit is contained in:
parent
1be71b8a99
commit
2e5a985e47
@ -30,12 +30,12 @@ import (
|
|||||||
|
|
||||||
type netlinkHandle struct {
|
type netlinkHandle struct {
|
||||||
netlink.Handle
|
netlink.Handle
|
||||||
ipv6 bool
|
isIPv6 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNetLinkHandle will crate a new NetLinkHandle
|
// NewNetLinkHandle will crate a new NetLinkHandle
|
||||||
func NewNetLinkHandle(ipv6 bool) NetLinkHandle {
|
func NewNetLinkHandle(isIPv6 bool) NetLinkHandle {
|
||||||
return &netlinkHandle{netlink.Handle{}, ipv6}
|
return &netlinkHandle{netlink.Handle{}, isIPv6}
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnsureAddressBind checks if address is bound to the interface and, if not, binds it. If the address is already bound, return true.
|
// EnsureAddressBind checks if address is bound to the interface and, if not, binds it. If the address is already bound, return true.
|
||||||
@ -182,8 +182,8 @@ func (h *netlinkHandle) GetLocalAddresses(dev, filterDev string) (sets.String, e
|
|||||||
if route.LinkIndex == filterLinkIndex {
|
if route.LinkIndex == filterLinkIndex {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if h.ipv6 {
|
if h.isIPv6 {
|
||||||
if route.Dst.IP.To4() == nil && ! route.Dst.IP.IsLinkLocalUnicast() {
|
if route.Dst.IP.To4() == nil && !route.Dst.IP.IsLinkLocalUnicast() {
|
||||||
res.Insert(route.Dst.IP.String())
|
res.Insert(route.Dst.IP.String())
|
||||||
}
|
}
|
||||||
} else if route.Src != nil {
|
} else if route.Src != nil {
|
||||||
|
@ -382,14 +382,14 @@ func NewProxier(ipt utiliptables.Interface,
|
|||||||
healthzServer: healthzServer,
|
healthzServer: healthzServer,
|
||||||
ipvs: ipvs,
|
ipvs: ipvs,
|
||||||
ipvsScheduler: scheduler,
|
ipvsScheduler: scheduler,
|
||||||
ipGetter: &realIPGetter{nl: NewNetLinkHandle(nodeIP.To4() == nil)},
|
ipGetter: &realIPGetter{nl: NewNetLinkHandle(isIPv6)},
|
||||||
iptablesData: bytes.NewBuffer(nil),
|
iptablesData: bytes.NewBuffer(nil),
|
||||||
filterChainsData: bytes.NewBuffer(nil),
|
filterChainsData: bytes.NewBuffer(nil),
|
||||||
natChains: bytes.NewBuffer(nil),
|
natChains: bytes.NewBuffer(nil),
|
||||||
natRules: bytes.NewBuffer(nil),
|
natRules: bytes.NewBuffer(nil),
|
||||||
filterChains: bytes.NewBuffer(nil),
|
filterChains: bytes.NewBuffer(nil),
|
||||||
filterRules: bytes.NewBuffer(nil),
|
filterRules: bytes.NewBuffer(nil),
|
||||||
netlinkHandle: NewNetLinkHandle(nodeIP.To4() == nil),
|
netlinkHandle: NewNetLinkHandle(isIPv6),
|
||||||
ipset: ipset,
|
ipset: ipset,
|
||||||
nodePortAddresses: nodePortAddresses,
|
nodePortAddresses: nodePortAddresses,
|
||||||
networkInterfacer: utilproxy.RealNetwork{},
|
networkInterfacer: utilproxy.RealNetwork{},
|
||||||
|
Loading…
Reference in New Issue
Block a user