Arthur Jones [Mon, 19 Mar 2018 17:04:00 +0000 (10:04 -0700)]
redhat: enable dist tarball to build in a chroot
When building the rpms, we can use a chroot (in my case docker) to
ensure that the BuildRequires are complete. This test failed with
errors like:
checking for CARES... no
configure: error: trying to build nhrpd, but libcares not found. install c-ares and its -dev headers.
error: Bad exit status from /var/tmp/rpm-tmp.FewvLf (%build)
This is due to a couple missing BuildRequires in the spec file. Here, we
add those in for all RPM builds.
Testing done:
Ran a docker build on CentOS7 which succeeded. Loaded the modules onto
CentOS6 to make sure they were at least valid there, that succeeded.
Issue: https://github.com/FRRouting/frr/issues/1930 Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
Donald Sharp [Mon, 19 Mar 2018 01:30:27 +0000 (21:30 -0400)]
zebra: Compare to the number of elements not size of array
When figuring out whom to call and if we actually can legally
call into the handler array actually use the number of elements
in the array instead of the size of the array.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 16 Mar 2018 14:53:58 +0000 (10:53 -0400)]
lib, zebra: Signal the existence of labels on a nexthop for nht
When we are signaling to a client from zebra that a nexthop
has changed, include the labels on the nexthop as well.
Upper level protocols need to know if the labels exist
in order to make intelligent decisions about what to do.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 16 Mar 2018 13:12:55 +0000 (09:12 -0400)]
bgpd: Clean up peer status checking for a received nlri
In bgp_update_receive the first thing we do is establish
that the peer->status is Established. We then do a bunch
of work and call bgp_nlri_parse where we break out for
each address family. Each AFI is then checking for
being peer->status is Established again. There is no
point in checking this again.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 15 Mar 2018 00:14:36 +0000 (20:14 -0400)]
zebra: Add some additional vrf info to debugs
There were several places where when I am attempting
to debug zebra functionality that I would really
like to have the ability to know what vrf I think
I am operating on.
Add the vrf_id to a bunch of zlog_debug messages
to help figure out issues when they happen.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Sat, 10 Mar 2018 20:12:52 +0000 (15:12 -0500)]
lib: Add nexthop-group cli
Add a nexthop-group cli:
nexthop-group NAME
nexthop A
nexthop B
nexthop C
!
This will allow interested parties to hook into the cli for
nexthops. Users can add callback functions for add/delete
of a nexthop group as well as add/delete of each individual
nexthop.
Future work( PBR and static routes ) will take advantage
of this.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Philippe Guibert [Tue, 13 Mar 2018 14:26:03 +0000 (15:26 +0100)]
lib: privileges are granted to vty netns command
Vty commands that link netns context to a vrf is requiring some
privileges. The change consists in retrieving the privileges at the
vrf_cmd_init() called by the relevant daemon. Then use it.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Quentin Young [Tue, 6 Mar 2018 23:08:37 +0000 (18:08 -0500)]
zebra: reorganize zserv, batch i/o
Group send and receive functions together, change handlers to take a
message instead of looking at ->ibuf and ->obuf, allow zebra to read
multiple packets off the wire at a time.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Tue, 6 Mar 2018 22:57:33 +0000 (17:57 -0500)]
zebra: standardize ZAPI message handler args
A lot of the handler functions that are called directly from the ZAPI
input processing code take different argument sets where they don't need
to. These functions are called from only one place and all have the same
fundamental information available to them to do their work. There is no
need to specialize what information is passed to them; it is cleaner and
easier to understand when they all accept the same base set of
information and extract what they need inline.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Tue, 6 Mar 2018 22:01:42 +0000 (17:01 -0500)]
zebra: dont return a status code in zapi handlers
All of the ZAPI message handlers return an integer that means different
things to each of them, but nobody ever reads these integers, so this is
technical debt that we can just eliminate outright.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Fri, 9 Mar 2018 17:07:25 +0000 (12:07 -0500)]
lib: add convenience debugging macros
* Add DEBUG*() macros
This set of macros allows you to write printf-like debugging lines that
automatically check whether a debug is on before printing. This should
eliminate the need for explicit checks in simple cases. For example:
if (SUCH_AND_SUCH_DEBUG_IS_ON) {
zlog_warn(...);
}
Becomes:
DEBUG(warn, such_and_such, ...);
Or, equivalently,
DEBUGE(such_and_such, ...);
The levels passed to DEBUG are expanded into the names of zlog_*
functions, so the same zlog levels are available. There's also a set of
macros that have the level built into them; DEBUGE for errors, DEBUGW
for warnings, etc. Good for brevity.
* Add singular setting macros
Change the 'SET' macros to accept a boolean indicating whether the
provided bits should be set or unset, and map on/off macros to them.
Helps condense code where you already have a boolean condition that
tells you what you want to do as you can avoid writing the branch.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Arthur Jones [Sun, 11 Mar 2018 17:32:24 +0000 (10:32 -0700)]
alpine: minimal alpine packaging
For building dev packages for alpine, we provide a minimal APKBUILD
file and add a configure option for only numeric versions in the
VERSION variable as alpine does not allow non-numeric characters
in the version string.
These changes allow alpine to be built, but don't yet provide a
mechanism to build. Changes to do the build in docker are coming
soon...
Testing done:
Built alpine packages in local docker environment, packages
showed no "dev" in the package name. Also built CentOS packages
with numeric version disabled and the "dev" is still in the package
name.
Issue: https://github.com/FRRouting/frr/issues/1859 Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>