Skip to content

Commit 417e009

Browse files
Merge pull request #655 from TrekkieCoder/main
in-cluster: fix to support when pod and loxilb are in same node
2 parents 9e2c8bd + 5340215 commit 417e009

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

api/api.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func RunAPIServer() {
124124
if options.Opts.TLS {
125125
server.TLSHost = options.Opts.TLSHost
126126
server.TLSPort = options.Opts.TLSPort
127-
127+
128128
server.TLSCertificateKey = options.Opts.TLSCertificateKey
129129
server.TLSCertificate = options.Opts.TLSCertificate
130130
}
@@ -134,7 +134,7 @@ func RunAPIServer() {
134134
os.Exit(0)
135135
}
136136
ApiReady = true
137-
137+
138138
if err := server.Serve(); err != nil {
139139
log.Fatalln(err)
140140
}

api/restapi/server.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/loxinet/layer3.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func (l3 *L3H) IfaSelectAny(addr net.IP, findAny bool) (int, net.IP, string) {
395395
if err == 0 {
396396
switch rtn := tDat.(type) {
397397
case *Neigh:
398-
if rtn != nil {
398+
if rtn != nil && rtn.OifPort != nil {
399399
IfObj = rtn.OifPort.Name
400400
}
401401
case *int:

pkg/loxinet/neighbor.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func NeighInit(zone *Zone) *NeighH {
125125
func (n *NeighH) Activate(ne *Neigh) {
126126

127127
interval := NeighAts * time.Second
128-
if tk.IsNetIPv6(ne.Addr.String()) || ne.Dummy {
128+
if tk.IsNetIPv6(ne.Addr.String()) || ne.Dummy || ne.OifPort == nil {
129129
return
130130
}
131131

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

0 commit comments

Comments
 (0)