Commit Graph

11367 Commits

Author SHA1 Message Date
Pascal Mathis
70ee29b4db
bgpd: Improve group overrides for AF filters
This commit adds the same peer-group override capabilites as d122d7cf7
for all filter/map options that can be enabled/disabled on each
address-family of a BGP peer.

All currently existing filter/map options are being supported:
filter-list, distribute-list, prefix-list, route-map and unsuppress-map

To implement this behavior, a new peer attribute 'filter_override' has
been added together with various PEER_FT_ (filter type) constants for
tracking the state of each filter in the same way as it is being done
with 'af_flags_override'.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-27 19:41:25 +02:00
Pascal Mathis
598ce6bd70
bgpd: Improve group overrides for AF flags
The current implementation for overriding peer-group configuration on a
peer member consists of several bandaids, which introduce more issues
than they fix. A generic approach for implementing peer-group overrides
for address-family flags is clearly missing.

This commit implements a generic and sane approach to overriding
peer-group configuration on a peer-member. A separate peer attribute
called 'af_flags_override' which was introduced in 04e1c5b is being used
to keep track of all address-family flags, storing whether the
configuration is being inherited from the parent-group or overridden.

All address-family flags are being supported by this implementation
(note: flags, not filters/maps) except 'send-community', which currently
breaks due to having the three flags enabled by default, which is not
being properly handled within this commit; all flags are supposed to
have an 'off'/'false' state by default.

In the interest of readability and comprehensibility, the flag
'send-community' is being fixed in a separate commit.

The following rules apply when looking at the new peer-group override
implementation this commit provides:

- Each peer-group can enable every flag (except the limitations noted
above), which gets automatically inherited to all members.

- Each peer can enable each flag independently and/or modify their
value, if available. (e.g.: weight <value>)

- Each command executed on a neighbor/peer gets explicitely set as an
override, so even when the peer-group has the same kind of
configuration, both will show up in 'show running-configuration'.

- Executing 'no <command>' on a peer will remove the peer-specific
configuration and make the peer inherit the configuration from the
peer-group again.

- Executing 'no <command>' on a peer-group will only remove the flag
from the peer-group, however not from peers explicitely setting that
flag.

This guarantees a clean implementation which does not break, even when
constantly messing with the flags of a peer-group. The same behavior is
present in Cisco devices, so people familiar with those should feel safe
when dealing with FRRs peer-groups.

The only restriction that now applies is that single peer cannot
disable a flag which was set by a peer-group, because 'no <command>' is
already being used for disabling a peer-specific override. This is not
supported by any known vendor though, would require many specific
edge-cases and magic comparisons and will most likely only end up
confusing the user. Additionally, peer-groups should only contain flags
which are being used by all peer members.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-27 19:41:23 +02:00
Jafar Al-Gharaibeh
f7fba3423b
Merge pull request #2248 from ppmathis/enhancement/bgp-adjacent-routes
bgpd: Improve show commands for adjacent routes (advertised/received-routes)
2018-05-27 12:53:33 -04:00
Russ White
e73f79ac4c
Merge pull request #2283 from donaldsharp/ignore_some_more
zebra: netlink cleanups
2018-05-27 11:02:15 -04:00
Russ White
5980e23123
Merge pull request #2291 from qlyoung/top-cleanup
*: remove update-autotools
2018-05-27 11:00:28 -04:00
Russ White
bac9485b03
Merge pull request #2295 from qlyoung/sort-vni
sort vni's
2018-05-27 10:59:19 -04:00
Russ White
e68677bd27
Merge pull request #2289 from qlyoung/list-sort
linklist sorting + hash table -> linklist
2018-05-27 10:56:57 -04:00
Russ White
bbc1a1d6bf
Merge pull request #2301 from LabNConsulting/working/master/bgpd-issue-2263-no-label-auto
bgpd: issue 2263: fix "no label vpn export auto"
2018-05-27 10:51:43 -04:00
G. Paul Ziemba
21a16cc2a3 bgpd: issue 2263: fix "no label vpn export auto"
This command should unset the label (instead of wrongly
setting to "auto")

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-05-26 07:05:42 -07:00
Donald Sharp
6ab5222f78 zebra: Add a breadcrumb for when we ignore a route
When we receive a route that we think we own and we
are not in startup conditions, then add a small debug
to help debug the issue when this happens, instead
of silently just ignoring the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-26 08:46:13 +02:00
Donald Sharp
d4d71f1133 tools, zebra: Use different protocol value for our statics
The re-use of RTPROT_STATIC has caused too many collisions
where other legitimate route sources are causing us to
believe we are the originator of the route.  Modify
the code so that if another protocol inserts RTPROT_STATIC
we will assume it's a Kernel Route.

Fixes: #2293
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-26 08:46:13 +02:00
Donald Sharp
22b788b4c4
Merge pull request #2300 from ajones-rvbd/ajones-issue-2299
zebra/if_netlink: trivial cleanup of IFLA_WIRELESS
2018-05-25 18:44:40 -04:00
Arthur Jones
0f08a57a07 zebra/if_netlink: trivial cleanup of IFLA_WIRELESS
With:
	commit ba7773964c
	Author: Renato Westphal <renato@opensourcerouting.org>
	Date:   Wed Sep 20 22:12:56 2017 -0300

We added our own copy of if_link.h (among others).  This
file unconditionally defines IFLA_WIRELESS, so we don't need
the conditional defines in the if_netlink.c code...

Issue: https://github.com/FRRouting/frr/issues/2299
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-05-25 14:34:32 -07:00
Quentin Young
cfb3b1a37d
Merge pull request #2272 from msablic/vtysh_reconnect
vtysh: reconnect to daemons when connection lost
2018-05-25 14:09:44 -04:00
Quentin Young
568b6b444e bgpd: sort vni's in running config
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25 16:39:38 +00:00
Quentin Young
6fd8c487e1 lib: add proper doc comments for hash & linklist
* Remove references to ospf source files from linklist.[ch]
* Remove documentation comments from hash.c and linklist.c
* Add comprehensive documentation comments to linklist.h and hash.h

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25 16:29:54 +00:00
Quentin Young
91f1037064 lib: add hash_to_list()
Convenience function to convert hash table to an unsorted linked list.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25 16:16:22 +00:00
Quentin Young
3a5c3bcb17 lib: add list_sort(), list_dup()
* list_dup(): duplicates a linked list
* list_sort(): in-place sort of linked list w/ ascending quicksort

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25 16:16:15 +00:00
Renato Westphal
cd126147a3
Merge pull request #2282 from dslicenc/cm20939-nbr-msg
bgpd: improve error message for neighbor not found
2018-05-25 10:20:39 -03:00
Quentin Young
44ee1b20c0 *: remove update-autotools
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-24 22:45:49 +00:00
Don Slice
9e6e6f46ee bgpd: additional neighbor message improvement
Added improved error message text to other places that could also
encounter the same condition.  In testing found that in certain
case, duplicate error messages were previously issued.  This fix
also removes the duplicates.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-05-24 10:58:37 -04:00
Don Slice
88b7d2555c bgpd: improve error message for neighbor not found
Problem reported due to tab completion showing all possible peers
in every vrf, but when neighbor in wrong vrf entered "no such
neighbor" is the error message.  Making it slightly more clear
with "no such neighbor in the view/vrf" to clue the user that they
may have specified the wrong vrf.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-05-24 10:51:17 -04:00
Donald Sharp
026a316f2c zebra: Fix RULE notification netlink messages
Fix the code so that we would actually start receiving
RULE netlink notifications.

The Kernel expects the long long to be a bit field
value, while the newer netlink message types are
an enum.  So we need to convert the message type
number to a bit position and set that value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-24 09:14:43 -04:00
Donald Sharp
2414abd3b0 zebra: Remove unnecessary function parameter
The snl variable is no longer needed to be passed around, so
remove it from the calling path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-24 09:14:43 -04:00
Donald Sharp
783827ae61 zebra: Move where we check for non-kernel netlink messages
Move where we check for non-kernel netlink messages to
a slightly earlier spot.  This will allow in subsuquent
commits the removal of an extra parameter that needs to
be passed around.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-24 09:14:43 -04:00
Donald Sharp
3575d9e866 zebra: Ignore most netlink notifications from ourselves
The BPF filter was an exclusion list of netlink messages
we did not want to receive from our self.  The problem
with this is that the exclusion list was and will be
ever growing.  So switch the test around to an inclusion
list since it is shorter and not growing.  Right
now this is RTM_NEWADDR and RTM_DELADDR.

Change some of the debug messages to error messages
so that when something slips through and it is unexpected
during development we will see the problem.

Also try to improve the documentation about what
the filter is doing and leave some breadcrumbs for
future developers to know where to change code
when new functionality is added.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-24 09:13:05 -04:00
Renato Westphal
19300af8f2
Merge pull request #2279 from donaldsharp/evpn_moo_moo
Evpn SA/CI issues found
2018-05-23 23:17:02 -03:00
Renato Westphal
39f7319dac
Merge pull request #2278 from donaldsharp/uninited_variable
bgpd: Fix use of uninitialized variable
2018-05-23 22:58:52 -03:00
Rafael Zalamena
2312209c8f
Merge pull request #2254 from qlyoung/fixup-vtysh-comments
misc cleanup for comments + docs
2018-05-23 14:00:15 -03:00
Quentin Young
ac40b262ef doc: remove duplicated packages from dep list
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-23 15:35:41 +00:00
Quentin Young
79871dbfcf doc: make frr a system group
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-22 21:46:08 +00:00
Quentin Young
07c40b22af doc: add install-info build dependency
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-22 21:46:02 +00:00
Quentin Young
d60d744157 doc: remove recommendation against integrated conf
Missed this in code review

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-22 21:14:00 +00:00
Quentin Young
f448f9145f doc: clean up 18.04 build doc
Some excess underlines, 4-space indents and typos cleaned up.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-22 21:14:00 +00:00
Quentin Young
76015847ea vtysh: rewrap comments
fixup comments for vtysh

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-22 21:14:00 +00:00
Renato Westphal
5f8247153b
Merge pull request #2280 from qlyoung/docuser
doc: move -r option docs to zebra only
2018-05-22 15:52:27 -03:00
Donald Sharp
b861cb7d2f
Merge pull request #2277 from pguibert6WIND/fix_case_zclient_broken
zebra: upon zclient breaking, flush PBR entries
2018-05-22 14:44:31 -04:00
Quentin Young
da7e1a9212 doc: move -r option docs to zebra only
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-22 17:55:20 +00:00
Donald Sharp
bb98075ed9
Merge pull request #2268 from opensourcerouting/rpki-spec-fix
redhat: Fix RPKI RPM build option (Master Branch)
2018-05-22 13:11:21 -04:00
Renato Westphal
92367796d2
Merge pull request #2273 from qlyoung/remove-retain-mode
*: remove -r from daemons except zebra
2018-05-22 12:49:24 -03:00
Philippe Guibert
4c0ec639fd zebra: upon zclient breaking, flush PBR entries
In case, the BGP or PBR daemon leaves, the PBR contexts created by this
daemon are flushed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-22 17:41:27 +02:00
Lou Berger
70b2080ccf
Merge pull request #2257 from donaldsharp/evpn_fixes
bgpd: Lock the parent rn as well
2018-05-22 11:33:01 -04:00
Quentin Young
06081c784f
Merge pull request #2220 from LabNConsulting/working/master/fix-asan
*: fix compile with -enable-address-sanitizer configured
2018-05-22 11:15:28 -04:00
Donald Sharp
5d9cbca226 bgpd: Ensure virt->vrfs is valid
Move the list_delete_and_null of the virt->vrfs code to
the actual deletion function to ensure proper lifecycle.
This assumption allows us to know that irt->vrfs is always
true so remove the NULL check on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-22 10:54:20 -04:00
Donald Sharp
b1ab0dfe20 bgpd: Free vni list on actual deletion
The irt->vnis list was being freed on going down,
but actually delete it from the deletion function.  Then
we can know that the irt->vnis is a valid list anywhere
we have a irt pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-22 10:50:53 -04:00
Donald Sharp
f9a789103f bgpd: Ensure we don't dereference a non-valid pointer
The attr->ecommunity may be null coming into the function
at this point.  Ensure that it is.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-22 10:44:32 -04:00
Donald Sharp
ba1976dbf8 bgpd: Fix use of uninitialized variable
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-22 09:53:01 -04:00
Renato Westphal
b16c827adf
Merge pull request #2262 from donaldsharp/v6_replace_semantics
V6 replace semantics
2018-05-22 09:05:06 -03:00
Quentin Young
c8dde10f58 *: remove -r from daemons except zebra
This option is only implemented by 4 daemons:
- BGPD
- RIPD
- RIPNGD
- Zebra

Manpages and documentation say that the option causes routes to not be
uninstalled from zebra when the daemon terminates. This is true for RIPD
and RIPNGD. This is not true for BGPD; in that daemon it only prevents
transmission of Cease / Peer Unconfig NOTIFICATION messages to peers.

Moreover, when any daemon disconnects from Zebra, all of its routes are
uninstalled from Zebra and the kernel regardless of this option,
rendering the option largely vestigial.

It is still useful in Zebra, where it prevents all routes from being
uninstalled when Zebra shuts down, so it is left there.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-21 19:09:49 +00:00
Mladen Sablic
67736451c5 vtysh: reconnect to daemons when connection lost
Functionality to let vtysh attempt to reconnect to daemons when
connection is lost (e.g. crash or restart).

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-05-21 20:51:03 +02:00