Don't send echo packets when the neighbor configures echo-interval of 0
(e.g. disabled).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
bfd_recv_ipv4() is getting an uninitialized buffer passed in as port,
and then checks it without clearing it first. Thus we can end up
leaving garbage data in it.
Signed-off-by: David Lamparter <equinox@diac24.net>
The log function would improperly format a string using an integer
causing a crash. This situation was found when switching echo mode with
a active connection.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Avoid all complexities of handling ethernet/IP/UDP headers and just use
UDP sockets: let the OS kernel handle this task.
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>
We'll reuse these functions later to receive echo packets, so we need
to despecialize them first. Another improvement here is that we are
going to remove the global buffer variable and opt to use the stack.
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>
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>
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>
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>
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>