`echo-mode` should and will automatically start after session goes up
and it is allowed by the remote peer. See `bs_echo_timer_handler` for
more information.
This avoids having echo controling code spread.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Remove some legacy left overs of the old timer data structure bits and
use a simpler version:
We always keep the current configuration in the timer structure, but
also keep the running timers (before poll transition) in
`cur_timers`.
With this we can remove `new_timers` and avoid timer copy
configuration copy on final handler (this also simplifies peer
show command).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Remove all polling negotiation when starting/stopping `echo-mode` as it
is not necessary.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Move timer calculation code outside of the packet handling function
and explain how timers are calculated.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Expand state change handling into smaller functions with more
explanatory commentaries. This also handles some corner cases that
were not being handled.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
The timer2str function thought 24 minutes was an hour and had a
couple of other issues that needed to be corrected.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don't use system calls to search for and get interface information,
instead use the FRR provided API to learn and cache it.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
The ->hash_cmp and linked list ->cmp functions were sometimes
being used interchangeably and this really is not a good
thing. So let's modify the hash_cmp function pointer to return
a boolean and convert everything to use the new syntax.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Use the proper multi hop hash for matching multi hop peers.
Spotted by Dmitrii Turlupov.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Don't send echo packets when the neighbor configures echo-interval of 0
(e.g. disabled).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Enumerate all codes, update the string representation and fix the
misdiagnosed echo failure.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Remove all VxLAN code. There are probably better ways to write VxLAN
support without having to use raw sockets and depend on extra user
configuration input.
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>
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>
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>
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>
After configuring a new value set the polling bit to negotiate speeds
again next transmission cycle.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>