Skip to content

Commit

Permalink
BFD config update after start BFD
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-netlox committed Feb 27, 2024
1 parent cf5ccfb commit e531287
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 8 additions & 0 deletions loxinet/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"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 Expand Up @@ -108,6 +109,13 @@ func (ci *CIStateH) startBFDProto() {
os.Exit(1)
}
tk.LogIt(tk.LogInfo, "KA - Added BFD remote %s:%s:%vus\n", ci.RemoteIP.String(), ci.SourceIP.String(), txInterval)
if _, err := os.Stat("/etc/loxilb/BFDconfig.txt"); errors.Is(err, os.ErrNotExist) {
if err != nil {
tk.LogIt(tk.LogInfo, "[Init] No BFD config file : %s \n", err.Error())
}
} else {
nlp.ApplyBFDConfig()
}
}

// CITicker - Periodic ticker for Cluster module
Expand Down
7 changes: 0 additions & 7 deletions loxinet/loxinet.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,6 @@ func loxiNetInit() {
if !opts.Opts.BgpPeerMode && clusterMode {
// Spawn CI maintenance application
mh.has.CISpawn()
if _, err := os.Stat("/etc/loxilb/BFDconfig.txt"); errors.Is(err, os.ErrNotExist) {
if err != nil {
tk.LogIt(tk.LogInfo, "[Init] No BFD config file : %s \n", err.Error())
}
} else {
nlp.ApplyBFDConfig()
}
}
// Initialize the loxinet global ticker(s)
mh.tDone = make(chan bool)
Expand Down

0 comments on commit e531287

Please sign in to comment.