Skip to content

Commit

Permalink
Merge pull request #676 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
kube-proxy: better conformance for flannel
  • Loading branch information
UltraInstinct14 committed May 14, 2024
2 parents f57b5c5 + bace148 commit 42d90f3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/loxinet/layer2.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,25 @@ func l2FdbAttrCopy(dst *FdbAttr, src *FdbAttr) {
dst.Dst = src.Dst
}


func (f *FdbEnt) tryResolveUpper(zn *Zone, addr net.IP) {
if f.Port == nil {
return
}
name := f.Port.Name
if f.Port.SInfo.PortReal != nil {
name = f.Port.SInfo.PortReal.Name
}

ret, Sip, _ := zn.L3.IfaSelect(name, addr, true)
if ret != 0 {
tk.LogIt(tk.LogDebug, "tryResolve: failed to select l3 ifa select (%s:%s)\n", name, addr.String())
return
}

go tk.ArpPing(addr, Sip, name)
}

// L2FdbResolveNh - For TunFDB, try to associate with appropriate neighbor
func (f *FdbEnt) L2FdbResolveNh() (bool, int, error) {
p := f.Port
Expand Down Expand Up @@ -142,9 +161,11 @@ func (f *FdbEnt) L2FdbResolveNh() (bool, int, error) {
switch rtn := tDat.(type) {
case *Neigh:
if rtn == nil {
f.tryResolveUpper(zone, attr.Dst)
return true, -1, errors.New("no neigh found")
}
default:
f.tryResolveUpper(zone, attr.Dst)
return true, -1, errors.New("no neigh found")
}
if nh, ok := tDat.(*Neigh); ok && !nh.Inactive && !nh.Dummy {
Expand Down

0 comments on commit 42d90f3

Please sign in to comment.