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>
Remove some more global variables and make the log messages look like
the rest of the code.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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>
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>
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>
This will make `bfdd` synchronize with its client when zebra dies or
bfdd is restarted.
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>