David Lamparter [Wed, 22 Aug 2018 15:39:12 +0000 (17:39 +0200)]
doc/developer: logging guide
This roughly outlines when to use which logging function. It's
certainly something to have to point people to, so they get things nice
and right - and so we get at least somewhat consistent behaviour for the
user.
Signed-off-by: David Lamparter <equinox@diac24.net>
Donald Sharp [Tue, 21 Aug 2018 12:40:51 +0000 (08:40 -0400)]
ospfd: Remove unused function
The ospf_external_route_lookup function was not
being used so let's just remove it.
Unfortunately the removal was not quite so simple as
that ospf_asbr.h was being used to generate a reference
for the `struct ospf_route` data structure, so we
need to fix up the compile by fixing up header
inclusions so that ospf_route.h is actually included
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac: emit a config warning if sphinx-build is missing
If we don't have --disabled-doc and sphinx-build is not available
warn the user that sphinx-build is needed to build documentation
as shown in the last line of config summary example below
FRRouting configuration
------------------------------
FRR version : 5.1-dev
host operating system : linux-gnu
source code location : .
compiler : gcc -std=gnu11
compiler flags : -g -Os -fno-omit-frame-pointer -funwind-tables -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -pthread
make : make
linker flags : -rdynamic -ldl -lm -lcrypt -ljson-c -lrt -lreadline -ltermcap -lm
state file directory : /var/run
config file directory : /usr/local/etc
example directory : /usr/local/etc
module directory : /usr/local/lib/frr/modules
user to run as : frr
group to run as : frr
group for vty sockets :
config file mask : 0600
log file mask : 0600
zebra protobuf enabled : no
The above user and group must have read/write access to the state file
directory and to the config files in the config file directory.
configure: WARNING: sphinx-build is missing but required to build documentation
Donald Sharp [Thu, 16 Aug 2018 20:29:08 +0000 (16:29 -0400)]
zebra: When using BFD ensure that zebra thinks ptm is disabled
In order for connected routes to be installed the if_is_operative
function is called. This function checks the status of ptm
and decides to use ptm enabled/disabled on the interface.
The call to zebra_ptm_get_enable was returning true and causing
the interface subsystem to do the wrong thing. Modify the
internal bfd case to when checking for ptm enabled to say it
is not enabled.
Tested-by: Mark Stapp <mjs@voltanet.io> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Sarita Patra [Thu, 16 Aug 2018 13:41:01 +0000 (06:41 -0700)]
pimd: Fix memory leak pim nexthop creation
While terminating pim instance, the memory allocated for pim nexthop
should be released before deallocating the memory of pim nexthop cache(pnc).
This resolves the memory leak detected in pnc->nexthop creation.
Donald Sharp [Thu, 16 Aug 2018 00:44:31 +0000 (20:44 -0400)]
bgpd: zlog_warn to assert for code that must be executed first
In bgp_keepalives.c, it was noticed that we were
ensuring that we called an intialization function first,
but this is a development escape in that once this
was fixed we never see it. So if a developer moves
this assumption around, let's crash the program and
lead them to this spot instead of silently ignoring
the problem.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 15 Aug 2018 19:50:30 +0000 (15:50 -0400)]
lib: Update hash.h documentation
The hash_get function when called and the alloc_func returns
a NULL value, we do not create a backet nor do we insert
anything into the hash. As such backet->data must always
be non-NULL.
Modify the description in hash_get to inform of this.
Additionally indicate that hash_walk and hash_iterate
cannot have a NULL backet->data value.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Rafael Zalamena [Wed, 15 Aug 2018 19:04:13 +0000 (16:04 -0300)]
bfdd: improve docs
Improvements:
* Show command line as code, to avoid confusion about single dash (`-`)
and double dash;
* Tell the user where the BGP BFD commands can be found;
* Document OSPF/OSPF6/PIM BFD commands;
* Document JSON commands;
* Tell about session counters;
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Mon, 13 Aug 2018 20:47:21 +0000 (17:47 -0300)]
bfdd: add new counters and command to show them
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>
Donald Sharp [Wed, 15 Aug 2018 19:06:53 +0000 (15:06 -0400)]
lib, ripngd, zebra: Remove pre-solaris 9 special cased code
The CMSG_FIRSTHDR was broken on solaris pre version 9. Version 9
was released in May of 2002 and EOL'ed in 2014. Version 8 EOL'ed
in 2012. Remove special case code for a little used platform
that has not seen the light of day in a very long time.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 15 Aug 2018 17:48:09 +0000 (13:48 -0400)]
bfdd: Fix `don't assign to value to ourself` compiler warning
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>
David Lamparter [Fri, 10 Aug 2018 15:35:29 +0000 (17:35 +0200)]
lib: add frr_elevate_privs() wrapper
Used as:
frr_elevate_privs(&my_privs) {
... code ...
}
and handles privilege raise/lower automatically in conjunction with the
C expression block. This makes it impossible to accidentally exit a
function with privileges raised (and then running a whole bunch of other
code with privs.)
Signed-off-by: David Lamparter <equinox@diac24.net>
Quentin Young [Tue, 19 Jun 2018 20:58:44 +0000 (20:58 +0000)]
*: fix source file headers & includes for errcodes
* Use the correct license header
* Stop headers from including themselves
* Use uniform relative include conventions
* Ensure that sources include what they use
* Turn off clang-format around struct array blocks
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Tue, 19 Jun 2018 20:28:45 +0000 (16:28 -0400)]
lib: Convert zlog_err for clippy build
The clippy code does not need to log the error messages
as errors as that it is only run as part of the build
itself and as long as we see the notifications we are good.
So convert zlog_err to zlog_notice so that we do not think
we have any zlog_err's in lib anymore
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>