Skip to content

Commit

Permalink
Merge pull request #556 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR - Fix for bfd showing wrong myIP
  • Loading branch information
UltraInstinct14 authored Feb 29, 2024
2 parents bac0ae0 + 1a634b7 commit ca1f843
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion loxinet/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package loxinet
import (
"errors"
"fmt"
nlp "github.com/loxilb-io/loxilb/api/loxinlp"
"net"
"os"
"time"
nlp "github.com/loxilb-io/loxilb/api/loxinlp"

cmn "github.com/loxilb-io/loxilb/common"
opts "github.com/loxilb-io/loxilb/options"
Expand Down
4 changes: 3 additions & 1 deletion proto/bfd.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type bfdSession struct {
State SessionState
MyMulti uint8
RemMulti uint8
MyIP net.IP
MyDisc uint32
RemDisc uint32
DesMinTxInt uint32
Expand Down Expand Up @@ -191,7 +192,7 @@ func (bs *Struct) BFDGet() ([]cmn.BFDMod, error) {
pair := strings.Split(s.RemoteName, ":")
temp.Instance = s.Instance
temp.RemoteIP = net.ParseIP(pair[0])
temp.SourceIP = tk.NltoIP(s.MyDisc)
temp.SourceIP = s.MyIP
port, _ := strconv.Atoi(pair[1])
temp.Port = uint16(port)
temp.Interval = uint64(s.DesMinTxInt)
Expand Down Expand Up @@ -420,6 +421,7 @@ func (b *bfdSession) initialize(remoteIP string, sourceIP string, port uint16, i
} else {
tk.LogIt(tk.LogDebug, "using bfd bind mydisc : %s\n", myIP.String())
}
b.MyIP = myIP
b.MyDisc = tk.IPtonl(myIP)
b.RemDisc = 0 //tk.IPtonl(ip)
b.MyMulti = multi
Expand Down

0 comments on commit ca1f843

Please sign in to comment.