Skip to content

Commit

Permalink
Merge pull request #539 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
bfd: support for param modification
  • Loading branch information
UltraInstinct14 authored Feb 21, 2024
2 parents 45a3c0f + 2c618e8 commit 0b897ad
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions proto/bfd.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ func (bs *Struct) BFDAddRemote(args ConfigArgs, cbs Notifer) error {

sess := bs.BFDSessMap[args.RemoteIP]
if sess != nil {
if sess.Instance == args.Instance {
if sess.DesMinTxInt != args.Interval {
sess.Fin <- true
sess.TxTicker.Stop()
sess.RxTicker.Stop()
sess.State = BFDDown

sess.DesMinTxInt = args.Interval
sess.ReqMinRxInt = args.Interval
sess.ReqMinEchoInt = args.Interval

sess.TxTicker = time.NewTicker(time.Duration(sess.DesMinTxInt) * time.Microsecond)
sess.RxTicker = time.NewTicker(time.Duration(BFDMinSysRXIntervalUs) * time.Microsecond)
go sess.bfdSessionTicker()

return nil
}
}
return errors.New("bfd existing session")
}

Expand Down Expand Up @@ -385,6 +403,8 @@ func (b *bfdSession) initialize(remoteIP string, sourceIP string, port uint16, i
func (b *bfdSession) destruct() {
b.State = BFDAdminDown
b.Fin <- true
b.TxTicker.Stop()
b.RxTicker.Stop()
// Signal ADMIN Down to peer
b.encodeCtrlPacket()
b.sendBFDPacket()
Expand Down

0 comments on commit 0b897ad

Please sign in to comment.