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

bfdd: fix broken FSM in active mode #11077

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

anlancs
Copy link
Contributor

@anlancs anlancs commented Apr 24, 2022

With the simple BFD configuration -
(active mode, single hop, without other parameters)

!
bfd
 peer 11.11.11.11
 exit
!

The interface with 11.11.11.0/24 is a virtual interface,
which can be deleted.

After BFD FSM is created and session is ok, do these things:

  1. delete this interface
  2. create this interface
  3. set same ip address in this interface

Now, everything seems completely restored because all configuration
is same. But bad thing happens, BFD session hang on "down" status -

root# show bfd peer 11.11.11.11
BFD Peer:
peer 11.11.11.11 vrf default
ID: 638815827
Remote ID: 0
Active mode
Status: down
Downtime: 3 second(s)
Diagnostics: path down <- caused by destroyed interface
Remote diagnostics: ok

With the interface creating, bfdd_sessions_enable_interface()
wrongly compares added interface with the created, even key of
this bfd_session isn't binded with any interface. So this
bfd_session will hang on "down" status for ever.

So skip the compare in this case (no interface in key) to wake up
this bfd_session.

Signed-off-by: anlan_cs vic.lan@pica8.com

With the simple BFD configuration -
(active mode, single hop, without other parameters)
```
!
bfd
 peer 11.11.11.11
 exit
!
```
The interface with 11.11.11.0/24 is a *virtual* interface,
which can be deleted.

After BFD FSM is created and session is ok, do these things:
1) delete this interface
2) create this interface
3) set same ip address in this interface

Now, everything seems completely restored because all configuration
is same. But bad thing happens, BFD session hang on "down" status -
```
root# show bfd peer 11.11.11.11
BFD Peer:
peer 11.11.11.11 vrf default
ID: 638815827
Remote ID: 0
Active mode
Status: down
Downtime: 3 second(s)
Diagnostics: path down <- caused by destroyed interface
Remote diagnostics: ok
```

With the interface creating, `bfdd_sessions_enable_interface()`
wrongly compares added interface with the created, even key of
this `bfd_session` isn't binded with any interface. So this
`bfd_session` will hang on "down" status for ever.

So skip the compare in this case (no interface in key) to wake up
this `bfd_session`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 24, 2022

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-5018/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 arm8 part 9: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 9: No useful log found
Successful on other platforms/tests
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 0
  • IPv4 protocols on Ubuntu 18.04
  • Static analyzer (clang)
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 amd64 part 9
  • Ubuntu 20.04 deb pkg check
  • Debian 10 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 amd64 part 1
  • Addresssanitizer topotests part 6
  • Ubuntu 18.04 deb pkg check
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 amd64 part 6
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 4
  • Addresssanitizer topotests part 4
  • Debian 9 deb pkg check
  • Topotests debian 10 amd64 part 3
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests Ubuntu 18.04 i386 part 9
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests debian 10 amd64 part 5
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests debian 10 amd64 part 0
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests Ubuntu 18.04 arm8 part 8
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 i386 part 7
  • IPv4 ldp protocol on Ubuntu 18.04
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 i386 part 0
  • Addresssanitizer topotests part 3
  • Topotests debian 10 amd64 part 8
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests debian 10 amd64 part 9
  • Addresssanitizer topotests part 2
  • IPv6 protocols on Ubuntu 18.04
  • Fedora 29 rpm pkg check
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 4

@anlancs
Copy link
Contributor Author

anlancs commented Apr 25, 2022

ci:rerun

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-5029/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@rzalamena rzalamena self-requested a review April 25, 2022 19:42
@rzalamena rzalamena merged commit ae75ec2 into FRRouting:master Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants