summaryrefslogtreecommitdiff
path: root/bfdd
AgeCommit message (Collapse)Author
2018-12-17bfdd: do not allow multihop peers without a local-addressRenato Westphal
The BFD code assumes that multihop peers have a local address configured. When that doesn't happen, the BFD client daemons fail to decode some BFD ZAPI messages and abort. To fix this, do not accept the configuration of multhop peers unless a local-address is configured. Fixes the following segfaults: - bgpd aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop" - bgpd aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop vrf NAME" - bgpd aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 vrf NAME multihop" - ospf6d aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop" - ospf6d aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop vrf NAME" - ospf6d aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 vrf NAME multihop" Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-30bfdd: fix multihop on FreeBSDRafael Zalamena
Some systems have a extra `struct sockaddr*` field (`_len`) which must be filled in order for the peer lookup to work. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org> (cherry picked from commit f43a14d2d3051899f77b859dd001b9478f6d9e86)
2018-11-08Merge pull request #3282 from opensourcerouting/60-fix-bfd-ipv6-unnumberedRuss White
6.0: bfdd: fix BGP unnumbered peer setup
2018-11-03bfdd: fix BGP unnumbered peer setupRafael Zalamena
The session key uses the scope id to figure out which interface we are using with that link-local address, so if we don't set it when registering a session we'll end up with multiple IPv6 sessions. This bug was spotted by Sandro Bolliger. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-10-25build: fix not building docs w/o sphinxDavid Lamparter
Can't build manpages without sphinx-build, oops... Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25*: cleanup .gitignore filesDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25build: move vtysh & manpage listings to subdir.amDavid Lamparter
Since we're now building through one large Makefile, we can easily put things with their daemons and crossreference nicely. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-22bfdd: fix multi hop hash lookupRafael Zalamena
Use the proper multi hop hash for matching multi hop peers. Spotted by Dmitrii Turlupov. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org> (cherry picked from commit 2055ea096923406e31a7d0a1a15406b3b62f2255)
2018-08-16bfdd: fix coverity scan issue (CID 1472622)Rafael Zalamena
Don't use the stack variable, but what we have recorded in our buffered data on the heap. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-16bfdd: improve ptm_adapter log messagesRafael Zalamena
Make them look like the rest of the daemon: message begins with a unique descriptive message to help locate debug messages. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-16bfdd: fix coverity scan issues (1472630, 1472623)Rafael Zalamena
Always initialize/santize string before calling the `read` function. It ensures that the debug function will always pick up the right thing. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-15bfdd: add new counters and command to show themRafael Zalamena
Added 3 new counters to BFD sessions: * Session up events count; * Session down events count; * Zebra notifications count; In addition to previosly available counters: * Count of received control packets; * Count of transmitted control packets; * Count of received echo packets; * Count of transmitted echo packets; With this count we are able to visualize the BFD activity, bandwidth usage, interface/network flapping and excess of zebra notifications. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-15bfdd: turn repeatable code into functionsRafael Zalamena
Turn some code that will be repeated in the next commits into functions so we avoid that. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-15Merge pull request #2838 from opensourcerouting/bfd-alpineDonald Sharp
bfdd: fix alpine build
2018-08-15bfdd: Fix `don't assign to value to ourself` compiler warningDonald Sharp
We were attempting to get around a unused value by setting a variable to itself, but it runs afoul of a different compiler and a message about not setting a variable to itself. So let's mark the ttl value as unused. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14bfdd: fix alpine buildRafael Zalamena
Move `recvmsg` parameter option initialization to function, initialize the parameter struct with zeroes and access field by name. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-14bfdd: fix downtime displayRafael Zalamena
BFD peer status show command was using the wrong variable to display the downtime counter. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: fix IPv6 peers using link-local addressRafael Zalamena
When using link-local address we must specify the scope-id for the address in order to bind to the interface. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: clean-up bfd clients data on shutdownRafael Zalamena
On `zebra` / `bfdd` shutdown we now clean up all client data to avoid memory leaks (ghost clients). This also prevents 'slow' shutdown on `zebra` sparing us from seeing some rare topotests shutdown failures (signal handler getting stopped by signal). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: improve logging messagesRafael Zalamena
Show a little more details, remove some duplicated calls and remove the macro compatibility with old debugging functions. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: clean up header inclusionRafael Zalamena
Most of the headers we need are included by zebra.h, so lets simplify this. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: code refactory for simplificationRafael Zalamena
Simplify code and remove unnecessary log messages. The old log messages are going to be shown by the caller anyway. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: free zebra clients data on unregistrationRafael Zalamena
Avoid a memory leak on client daemons restart by getting rid of old registrations. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: send replay request on zebra connectionRafael Zalamena
This will make `bfdd` synchronize with its client when zebra dies or bfdd is restarted. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: show single hop local-addressRafael Zalamena
Show local-address on single hop when configured. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: smooth configuration transitionRafael Zalamena
After configuring a new value set the polling bit to negotiate speeds again next transmission cycle. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: show the correct transmission speedRafael Zalamena
When configured transmission speed doesn't match the actual speed, show the difference in the output. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: re-route PTM-BFD daemon messagesRafael Zalamena
When `bfdd` is enabled - which it is by default - re-route the PTM-BFD messages to the FRR's internal BFD daemon instead of the external PTM daemon. This will help the migration of BFD implementations and avoid duplicating code. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: add vty shell commandsRafael Zalamena
Implement vty shell integration and allow `bfdd` to be configured through FRR's vtysh. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: imported new daemon source codeRafael Zalamena
Import source code from external `bfdd` daemon ported from Cumulus PTM. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>