Skip to content

Commit

Permalink
Merge pull request #655 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
in-cluster: fix to support when pod and loxilb are in same node
  • Loading branch information
UltraInstinct14 authored Apr 26, 2024
2 parents 9e2c8bd + 5340215 commit 417e009
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func RunAPIServer() {
if options.Opts.TLS {
server.TLSHost = options.Opts.TLSHost
server.TLSPort = options.Opts.TLSPort

server.TLSCertificateKey = options.Opts.TLSCertificateKey
server.TLSCertificate = options.Opts.TLSCertificate
}
Expand All @@ -134,7 +134,7 @@ func RunAPIServer() {
os.Exit(0)
}
ApiReady = true

if err := server.Serve(); err != nil {
log.Fatalln(err)
}
Expand Down
2 changes: 1 addition & 1 deletion api/restapi/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/loxinet/layer3.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func (l3 *L3H) IfaSelectAny(addr net.IP, findAny bool) (int, net.IP, string) {
if err == 0 {
switch rtn := tDat.(type) {
case *Neigh:
if rtn != nil {
if rtn != nil && rtn.OifPort != nil {
IfObj = rtn.OifPort.Name
}
case *int:
Expand Down
5 changes: 4 additions & 1 deletion pkg/loxinet/neighbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func NeighInit(zone *Zone) *NeighH {
func (n *NeighH) Activate(ne *Neigh) {

interval := NeighAts * time.Second
if tk.IsNetIPv6(ne.Addr.String()) || ne.Dummy {
if tk.IsNetIPv6(ne.Addr.String()) || ne.Dummy || ne.OifPort == nil {
return
}

Expand Down Expand Up @@ -366,6 +366,9 @@ func (n *NeighH) NeighAdd(Addr net.IP, Zone string, Attr NeighAttr) (int, error)
tk.LogIt(tk.LogError, "neigh add - %s:%s no oport\n", Addr.String(), Zone)
if !found {
n.NeighMap[key] = &Neigh{Dummy: true, Attr: Attr, NhRtm: make(map[RtKey]*Rt)}
} else {
ne.Dummy = true
ne.OifPort = nil
}
return NeighOifErr, errors.New("nh-oif error")
}
Expand Down

0 comments on commit 417e009

Please sign in to comment.