Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bfd: support for param modification #539

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading