Donald Sharp [Fri, 20 Apr 2018 14:18:47 +0000 (10:18 -0400)]
pbrd: Fix a couple SA issues
1) addr will never be non-null because of the way we build the cli
at this point in time, but the SA system does not understand this,
add a bread crumb for it.
2) Fix a possible memory leak of the pbr_ifp
3) Fix possible integer overflow when bit shifting.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Sat, 21 Apr 2018 23:59:25 +0000 (19:59 -0400)]
bgpd: The deletion of a bgp route does not need to send some data
When sending a bgp route down to zebra for deletion, the
ZEBRA_FLAG_ALLOW_RECURSION and ZEBRA_FLAG_IBGP flags
are not needed in zebra. So remove the setting
of the api.flags. If we remove this data from being
passed down we no longer need the peer data structure.
Remove the lookup of the peer data structure and the setting
of the flags as that peer was NULL in some evpn symmetric
routing cases for shutdown of bgp.
Ticket: CM-20720 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Thu, 19 Apr 2018 21:04:05 +0000 (21:04 +0000)]
zebra: resolve issue when changing import-table route-map config
When changing from "ip import-table 10 route-map rdn" to "ip
import-table 10" without a route-map, routes would be deleted
and not reinstalled. This fix resolves that problem.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Arthur Jones [Wed, 18 Apr 2018 17:18:00 +0000 (10:18 -0700)]
alpine build docs: Document docker images and alpine packages
https://hub.docker.com/r/ajones17/frr/ contains pre-built docker
images and alpine packages for the master branch of frr. Document
this continuous delivery system on the alpine build page.
Issue: https://github.com/FRRouting/frr/issues/2087 Signed-of-by: Arthur Jones <arthur.jones@riverbed.com>
Donald Sharp [Wed, 18 Apr 2018 15:10:27 +0000 (11:10 -0400)]
zebra: Add pass up through zapi what zebra is capable of handling
Zebra is starting to have some run-time capabilites that would be
useful to pass up to the higher level protocols so that they
can act in an appropriate manner when needed.
Send the ecmp value zebra is being run with and whether or not
we believe mpls is enabled in the kernel or not.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Previous code allowed leaking if the named FOO route-map was not defined.
Since the configuration is logically incomplete, if a route-map is named
for "vpn export" or "vpn import" but is not defined, leaking should not
occur until the route-map is defined.
Donald Sharp [Mon, 9 Apr 2018 19:41:37 +0000 (15:41 -0400)]
pbrd: Allow pbr-policy add/removal to install/remove rules
The pbrm->installed variable was being used only in a couple
of places and it has no real bearing on whether or not
we should install a rule or not. Remove this value.
Ticket: CM-20429 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 6 Apr 2018 15:41:10 +0000 (11:41 -0400)]
pbrd: Fix installation and deletion in some cases
When a nexthop group is modified do not assume that it
is not installed. The creation of the pnhgc is enough
to set the installed to false. If we are reinstalling
it is not needed to set it as not installed.
When a pbrms is being installed/removed check to see if it
is already installed/deleted and do the right thing from
there.
Ticket: CM-20371 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 30 Mar 2018 14:33:25 +0000 (10:33 -0400)]
zebra: Tell rib_process to actually rethink pbr routes.
When I implemented this code change I was only testing against
static routes and with one nexthop. I missed the fact that
we needed to tell rib_process to actually rethink the nexthops.
Ticket: CM-20274 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Thu, 12 Apr 2018 20:44:03 +0000 (16:44 -0400)]
vtysh: remove exit-vrf for vtysh -m
How It's Made:
- vtysh -m is for frr-reload.py to know when a context ends. This is
done by executing commands against the CLI graph, checking for walkup,
and putting the appropriate context exit if walkup is necessary. Thus
the default case for walking up from a vrf context is fine, and
doesn't need a specific exit-vrf command. Remove that.
- exit-vrf needs to be explicitly printed at the end of vrf config
printing. We already do this.
- vtysh's special snowflake config prettiness logic needs to know that
exit-vrf goes with the vrf block and needs to be explicitly told not
place this in alphabetical order in that block. We also already do
this.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Tue, 17 Apr 2018 17:39:06 +0000 (13:39 -0400)]
zebra: Leave some warning breadcrumbs
When a user specifies static routes, there are a couple of states
where we will store the route and display it as part of the 'show run'
but it will not be installed until such time that the dependant state
is created. Add some breadcrumbs to the user so that they can figure
out WTF just happened.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Mon, 16 Apr 2018 18:37:30 +0000 (14:37 -0400)]
ospfd: fix stylistic issue
Macro that expands to be wrapped in parentheses was being used as a raw
condition for an if statement, leading to some very weird and confusing
formatting...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Don Slice [Tue, 17 Apr 2018 17:48:30 +0000 (10:48 -0700)]
zebra: fix flaw in fix for import-table crash
Realized (with coverity's help) the fix had a mistake by pasting in
the wrong route entry to unset the selected flag. This fix takes
care of that mistake.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Donald Sharp [Mon, 16 Apr 2018 22:42:40 +0000 (18:42 -0400)]
zebra: Allow blackhole route deletion for prefixes
With the recent change to just pass the prefix in
for the RTM_DELROUTE, for blackhole routes we
had stopped modifying the req.rtm_type to
be the appropriate type for blackhole routes.
Since we are just deleting on the route, and
zebra is never going to really install the same
route multiple times then we do not need
to specify the req.r.rtm_type for the deletion
command.
Ticket: CM-20616 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Sun, 15 Apr 2018 19:25:24 +0000 (12:25 -0700)]
zebra: resolve assert when adding ip import-table entry
Problem was due to in certain route replace circumstances,
we would mark the old route_entry as removed to delete it but
would leave the selected flag set. When the rn was pulled off the
work queue for process, we would find both the new re and old re
(being deleted) with the selected flag set and would assert.
In this change, when we decide to delete the old re, we also mark
it as no longer selected.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Philippe Guibert [Sat, 24 Mar 2018 13:58:04 +0000 (14:58 +0100)]
zebra: rename pbr_unique structure to pbr_rule_unique
This renaming of structure permits better identify which structure is
looked up, since policy routing will not only rely on iprule, but also
on some other structures.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Wed, 21 Mar 2018 10:59:02 +0000 (11:59 +0100)]
zebra: adapt zebra_pbr_rule based with pbr_rule
In order to avoid duplicates functions, the zebra_pbr_rule structure
used by zebra to decode the zapi message, and send netlink messages, is
slightly modified. the structure is derived from pbr_rule, but it also
includes sock identifier that is used to send back information to the
daemon that did the request. Also, the ifp pointer is stored in that
structure.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Wed, 21 Mar 2018 10:55:38 +0000 (11:55 +0100)]
lib: enhance pbr_rule structure for zapi encode and for common usage
The pbr_rule structure is derived from zebra_pbr_rule, and is
defined, so that a zclient will be able to encode the zebra_pbr_rule to
send ADD_RULE or DEL_RULE command. Also, the same structure can be used
by other daemons to derive a structure ( this will be the case for
zebra_pbr_rule).
Adding to this, an encoding function is defined, and will be used by
remote daemon to encode that message.
Those definitions are moved in new file pbr.h file.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 12 Mar 2018 08:23:48 +0000 (09:23 +0100)]
zebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapi
Those messages permit a remote daemon to configure an iptable entry. A
structure is defined that maps to an iptable entry. More specifically,
this structure proposes to associate fwmark, and a table ID.
Adding to the configuration, the initialisation of iptables hash list is
done into zebra netnamespace. Also a hook for notifying the sender that
the iptables has been correctly set is done.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Quentin Young [Wed, 11 Apr 2018 19:19:23 +0000 (15:19 -0400)]
babeld: be more explicit about route resize result
Resizing the route array can fail. Although the error condition is
already correctly handled, if we're more explicit about the variables we
expect to be initialized then clang-analyze is happier.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>