| Age | Commit message (Collapse) | Author | 
 | 
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>
 | 
 | 
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)
 | 
 | 
6.0: bfdd: fix BGP unnumbered peer setup
 | 
 | 
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>
 | 
 | 
Can't build manpages without sphinx-build, oops...
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
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>
 | 
 | 
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)
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
bfdd: fix alpine build
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
BFD peer status show command was using the wrong variable to display the
downtime counter.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
Most of the headers we need are included by zebra.h, so lets simplify
this.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
Avoid a memory leak on client daemons restart by getting rid of old
registrations.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
This will make `bfdd` synchronize with its client when zebra dies or
bfdd is restarted.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
Show local-address on single hop when configured.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
After configuring a new value set the polling bit to negotiate speeds
again next transmission cycle.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
When configured transmission speed doesn't match the actual speed, show
the difference in the output.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
Implement vty shell integration and allow `bfdd` to be configured
through FRR's vtysh.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 | 
 | 
Import source code from external `bfdd` daemon ported from Cumulus PTM.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
 |