Merge pull request #103 from squat/ignore_kilo_ip_when_finding_internal_ips
pkg/mesh/mesh.go: ignore Kilo IP during discovery
This commit is contained in:
commit
92825ba0c7
@ -108,15 +108,6 @@ func New(backend Backend, enc encapsulation.Encapsulator, granularity Granularit
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to query netlink for CNI device: %v", err)
|
||||
}
|
||||
privateIP, publicIP, err := getIP(hostname, enc.Index(), cniIndex)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find public IP: %v", err)
|
||||
}
|
||||
ifaces, err := interfacesForIP(privateIP)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find interface for private IP: %v", err)
|
||||
}
|
||||
privIface := ifaces[0].Index
|
||||
var kiloIface int
|
||||
if createIface {
|
||||
kiloIface, _, err = wireguard.New(iface)
|
||||
@ -130,6 +121,15 @@ func New(backend Backend, enc encapsulation.Encapsulator, granularity Granularit
|
||||
}
|
||||
kiloIface = link.Attrs().Index
|
||||
}
|
||||
privateIP, publicIP, err := getIP(hostname, kiloIface, enc.Index(), cniIndex)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find public IP: %v", err)
|
||||
}
|
||||
ifaces, err := interfacesForIP(privateIP)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find interface for private IP: %v", err)
|
||||
}
|
||||
privIface := ifaces[0].Index
|
||||
if enc.Strategy() != encapsulation.Never {
|
||||
if err := enc.Init(privIface); err != nil {
|
||||
return nil, fmt.Errorf("failed to initialize encapsulator: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user