Skip to content

Commit

Permalink
Merge pull request #455 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR: gobgp peer mode fixes
  • Loading branch information
UltraInstinct14 authored Dec 7, 2023
2 parents 199fbb8 + e6e9b42 commit a3dcf52
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion loxinet/gobgpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ type GoBgpH struct {
ciMap map[string]*goCI
reqRst bool
reSync bool
pMode bool
resetTS time.Time
}

Expand Down Expand Up @@ -464,6 +465,7 @@ func GoBgpInit(bgpPeerMode bool) *GoBgpH {
}
gbh.state = BGPDisconnected
gbh.tDone = make(chan bool)
gbh.pMode = bgpPeerMode
gbh.ticker = time.NewTicker(30 * time.Second)
gbh.fTicker = time.NewTicker(5 * time.Second)
go gbh.goBGPTicker()
Expand Down Expand Up @@ -1214,6 +1216,10 @@ func getRoutesAndAdvertise() {

// goBGPLazyHouseKeeper - Periodic (lazy) house keeping operations
func (gbh *GoBgpH) goBGPLazyHouseKeeper() {
if gbh.pMode {
return
}

gbh.mtx.Lock()
defer gbh.mtx.Unlock()

Expand All @@ -1229,7 +1235,7 @@ func (gbh *GoBgpH) goBGPHouseKeeper() {

rsync := false

if gbh.reSync {
if gbh.reSync || gbh.pMode {
if err := gbh.AddCurrBgpRoutesToIPRoute(); err != nil {
tk.LogIt(tk.LogError, "[GoBGP] AddCurrentBgpRoutesToIpRoute() return err: %s\n", err.Error())
}
Expand Down

0 comments on commit a3dcf52

Please sign in to comment.