]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agotests: Fix crash in test_mp_attr
Donald Sharp [Wed, 11 Apr 2018 12:56:44 +0000 (08:56 -0400)]
tests: Fix crash in test_mp_attr

Some recent changes in BGP now require that the
peer's nexthop have a valid ifp when we are looking
at:

case BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL:
case BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL:

This assumption makes sense for this type of Nexthop Attribute.
So for the test let's jimmy up a `fake` enough interface pointer
so that the actual test we can focus on what we are actually
testing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: add import vrf route-map command
Don Slice [Thu, 29 Mar 2018 16:00:21 +0000 (16:00 +0000)]
bgpd: add import vrf route-map command

Added the cli for doing route-map filtering on imported routes via
the new "import vrf route-map <NAME> command.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: Handle connected routes and IPv6 link-local nexthops for route leaking
vivek [Thu, 5 Apr 2018 17:42:27 +0000 (10:42 -0700)]
bgpd: Handle connected routes and IPv6 link-local nexthops for route leaking

Connected routes redistributed into BGP as well as IPv4 routes with IPv6
link-local next hops (RFC 5549) need information about the associated
interface in BGP if they are candidates to be leaked into another VRF. In
the absence of route leaking, this was not necessary. Introduce the
appropriate mechanism and ensure this is used during route install (in
the target VRF).

Ticket: CM-20343, CM-20382
Testing done:
1. Manually verified failed scenarios and some additional ones - logs
in the tickets.
2. Ran bgp-min and evpn-min - results are good.
3. Ran vrf smoke - has some failures, but none which look new

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agobgpd: Fix route-leak/L3VPN delete of redistributed routes
vivek [Wed, 4 Apr 2018 16:43:14 +0000 (09:43 -0700)]
bgpd: Fix route-leak/L3VPN delete of redistributed routes

Ensure that when a route redistributed into a VRF is subsequently
deleted, it is properly removed from the VPN table (if exported)
so that it can be removed from other VRFs and withdrawn from
L3VPN peers.

Ticket: CM-20345
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agobgpd: Enhance loop checking for VRF to VPN route export
vivek [Thu, 29 Mar 2018 05:13:05 +0000 (22:13 -0700)]
bgpd: Enhance loop checking for VRF to VPN route export

The VRF routes exported to the global VPN table must not be
imported routes. It is not necessary to check if they originate
in the global VPN instance as that doesn't hold good for VRF-to-
VRF route-leaking. Merely checking that they are not imported
should handle both L3VPN and VRF-to-VRF route-leaking use cases.

Ticket: CM-20283
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agobgpd: Fix peer determination from parent for imported routes
vivek [Thu, 29 Mar 2018 05:11:30 +0000 (22:11 -0700)]
bgpd: Fix peer determination from parent for imported routes

When routes are imported into a VRF from the global VPN table, the
parent instance is either the default instance in the case of L3VPN or
the source VRF in the case of VRF-to-VRF route leaking. Hence, obtain
the source peer by just looking at the parent route information.

Ticket: CM-20283
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agobgpd: Implement show command for VRF route leaking
vivek [Tue, 27 Mar 2018 17:58:13 +0000 (10:58 -0700)]
bgpd: Implement show command for VRF route leaking

Implement "show bgp [vrf FOO] <afi> <safi> route-leak" which displays
operational information about VRF route leaking.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fixes for VRF route leaking
vivek [Tue, 27 Mar 2018 00:24:47 +0000 (17:24 -0700)]
bgpd: Fixes for VRF route leaking

Implement fixes for route leaking between VRFs through BGP, especially for
the scenario where routes are leaked from a VRF X to multiple other VRFs.
This include making sure that import and export happen via the global VPN
table, setting RD correctly and proper handling for multiple import/export.

Ticket: CM-20256
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Auto RD definitions and encoding
vivek [Tue, 27 Mar 2018 00:11:39 +0000 (17:11 -0700)]
bgpd: Auto RD definitions and encoding

Setup a per-VRF identifier to use along with the Router Id to build the
RD. Define a function to encode the RD. Code is brought over from EVPN
and EVPN code has been modified to use the generic function.

Ticket: CM-20256
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agobgpd: Fix params/checks for route leaking and L3VPN
vivek [Tue, 27 Mar 2018 00:04:24 +0000 (17:04 -0700)]
bgpd: Fix params/checks for route leaking and L3VPN

When routes are injected into the VPN table and then leaked into candidate
VRFs, the source should be the default instance. Also, the loop check when
withdrawing routes from a VRF should be that the route's origin isn't that
VRF; this handles VRF route leaking also and is consistent with checks in
other places.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
(cherry picked from commit 0149d2848c59bfb3277592caf0a5d5e07a2de872)

Ticket: CM-20256

6 years agobgpd: resolve flag definition confict for af_flags under bgp vrf
Mitesh Kanjariya [Mon, 26 Mar 2018 08:55:28 +0000 (01:55 -0700)]
bgpd: resolve flag definition confict for af_flags under bgp vrf

afi/safi flags defined under bgp vrf needs to be unique across afi/safi.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: Handle when the import vrf has not been created.
Donald Sharp [Sat, 24 Mar 2018 22:55:30 +0000 (18:55 -0400)]
bgpd: Handle when the import vrf has not been created.

When the `import vrf XXX` command is entered under
an afi/safi for bgp and the XXX vrf bgp instance
does not yet exist, auto-create it using the same
ASN that the we are importing into.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Implement vrf - vrf route leaking cli
Donald Sharp [Mon, 19 Mar 2018 19:41:17 +0000 (15:41 -0400)]
bgpd: Implement vrf - vrf route leaking cli

add the `import vrf XXXX` command

router bgp 4 vrf DONNA
  <config>
!

router bgp 4 vrf EVA
  <config>
  address-family ipv4 uni
    import vrf DONNA
  !
!

This command will allow for vrf EVA to specify that it would like
to receive the routes from vrf DONNA into it's table.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2110 from msablic/pim_mtrace_group
Donald Sharp [Wed, 25 Apr 2018 00:08:06 +0000 (20:08 -0400)]
Merge pull request #2110 from msablic/pim_mtrace_group

pimd: adding querying of state to mtrace

6 years agoMerge pull request #2117 from mjstapp/vty_do_mem
Quentin Young [Tue, 24 Apr 2018 21:08:51 +0000 (17:08 -0400)]
Merge pull request #2117 from mjstapp/vty_do_mem

vtysh: use 'do' for show memory and show modules

6 years agovty: use 'do' for show memory and show modules
Mark Stapp [Thu, 19 Apr 2018 18:00:04 +0000 (14:00 -0400)]
vty: use 'do' for show memory and show modules

show mem and show modules won't work in config modes without
passing 'do' to other running daemons.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agopimd: adding querying of state to mtrace
Mladen Sablic [Thu, 12 Apr 2018 11:24:21 +0000 (13:24 +0200)]
pimd: adding querying of state to mtrace

Adding to mtracebis querying with group address. Same change
to vtysh mtrace command. Support for querying (S,G) and (*,G)
state in mtrace router code. Further improvments to mtrace router
code with closer complience to IETF draft. More references in
comments to the draft. Man page has been updated accordingly.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
6 years agoMerge pull request #2100 from chiragshah6/ospfv3_dev
Lou Berger [Tue, 24 Apr 2018 15:53:20 +0000 (11:53 -0400)]
Merge pull request #2100 from chiragshah6/ospfv3_dev

ospf6d: fix ospf6 asbr crash

6 years agoMerge pull request #2097 from qlyoung/show-cmdgraph
Russ White [Tue, 24 Apr 2018 15:31:11 +0000 (11:31 -0400)]
Merge pull request #2097 from qlyoung/show-cmdgraph

Show cmdgraph

6 years agoMerge pull request #2113 from donaldsharp/attr_debug
Russ White [Tue, 24 Apr 2018 13:04:03 +0000 (09:04 -0400)]
Merge pull request #2113 from donaldsharp/attr_debug

bgpd: Add some additional attribute information to dump

6 years agoMerge pull request #2112 from mjstapp/ospf_debug
Russ White [Tue, 24 Apr 2018 13:03:33 +0000 (09:03 -0400)]
Merge pull request #2112 from mjstapp/ospf_debug

ospfd: use prefix2str more consistently in zebra module debugs

6 years agoMerge pull request #2106 from qlyoung/zapi-msg
Russ White [Tue, 24 Apr 2018 12:23:42 +0000 (08:23 -0400)]
Merge pull request #2106 from qlyoung/zapi-msg

Split out ZAPI message creation / consumption from server implementation

6 years agoMerge pull request #2104 from LabNConsulting/working/master/bvl-src-bgp
Russ White [Tue, 24 Apr 2018 12:12:03 +0000 (08:12 -0400)]
Merge pull request #2104 from LabNConsulting/working/master/bvl-src-bgp

bgpd: bugfix: vpn-vrf leak: set origin bgp to origin vrf for vrf-vpn-vrf

6 years agoMerge pull request #2099 from qlyoung/fix-cpu-thread-hist-race
Russ White [Tue, 24 Apr 2018 11:59:06 +0000 (07:59 -0400)]
Merge pull request #2099 from qlyoung/fix-cpu-thread-hist-race

lib: fix data race in thread history collection

6 years agoMerge pull request #2090 from qlyoung/graph-dfs
Russ White [Tue, 24 Apr 2018 11:53:09 +0000 (07:53 -0400)]
Merge pull request #2090 from qlyoung/graph-dfs

lib: add DFS + DOT dumping to graph datastructure

6 years agoMerge pull request #2094 from donaldsharp/pbr_fixes
Russ White [Tue, 24 Apr 2018 11:48:52 +0000 (07:48 -0400)]
Merge pull request #2094 from donaldsharp/pbr_fixes

Pbr fixes

6 years agoMerge pull request #2095 from donaldsharp/2060_fixup
Lou Berger [Tue, 24 Apr 2018 11:15:09 +0000 (07:15 -0400)]
Merge pull request #2095 from donaldsharp/2060_fixup

resolve possible null pointer dereference

6 years agolib: Fix SA warning
Donald Sharp [Fri, 20 Apr 2018 14:31:45 +0000 (10:31 -0400)]
lib: Fix SA warning

The addr value will never be null because of the way we do the
cli, but the SA system doesn't understand this.  Add an assert
to make it happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Fix a couple SA issues
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>
6 years agoisisd: resolve possible null pointer dereference
Ilya Shipitsin [Thu, 12 Apr 2018 18:23:21 +0000 (23:23 +0500)]
isisd: resolve possible null pointer dereference

issue found by cppcheck

[isisd/dict.c:1320] -> [isisd/dict.c:1065]:
(warning) Either the condition '!dn' is redundant or
there is possible null pointer dereference: newnode.

[isisd/dict.c:1320] -> [isisd/dict.c:1068]:
(warning) Either the condition '!dn' is redundant or
there is possible null pointer dereference: newnode.

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Add some additional attribute information to dump
Donald Sharp [Mon, 23 Apr 2018 19:24:26 +0000 (15:24 -0400)]
bgpd: Add some additional attribute information to dump

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospfd: use prefix2str in debugs in zebra module
Mark Stapp [Mon, 23 Apr 2018 19:57:25 +0000 (15:57 -0400)]
ospfd: use prefix2str in debugs in zebra module

Clean up a typo or two, and use prefix2str consistently.

6 years agoMerge pull request #2111 from mjstapp/zmq_sockopt
Quentin Young [Mon, 23 Apr 2018 18:33:41 +0000 (14:33 -0400)]
Merge pull request #2111 from mjstapp/zmq_sockopt

frrzmq: properly init args to zmq_getsockopt()

6 years agofrrzmq: properly init args to zmq_getsockopt()
Mark Stapp [Tue, 17 Apr 2018 19:19:34 +0000 (15:19 -0400)]
frrzmq: properly init args to zmq_getsockopt()

zmq read events get lost if zmq_getsockopt() silently fails in
frrzmq_check_events().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agoMerge pull request #2103 from donaldsharp/bgp_zebra_youch
Lou Berger [Mon, 23 Apr 2018 15:02:15 +0000 (11:02 -0400)]
Merge pull request #2103 from donaldsharp/bgp_zebra_youch

bgpd: The deletion of a bgp route does not need to send some data

6 years agoMerge pull request #2098 from qlyoung/fix-underline-buf-overflow
Lou Berger [Mon, 23 Apr 2018 15:01:34 +0000 (11:01 -0400)]
Merge pull request #2098 from qlyoung/fix-underline-buf-overflow

lib: fix dynamic stack buffer overflow

6 years agoMerge pull request #2108 from donaldsharp/redistribute_debugs
Lou Berger [Mon, 23 Apr 2018 14:56:44 +0000 (10:56 -0400)]
Merge pull request #2108 from donaldsharp/redistribute_debugs

zebra: Add some information to redistribute debugs

6 years agoMerge pull request #2105 from qlyoung/fix-includes
Lou Berger [Mon, 23 Apr 2018 14:55:00 +0000 (10:55 -0400)]
Merge pull request #2105 from qlyoung/fix-includes

lib: table.h needs to include prefix.h

6 years agozebra: Add some information to redistribute debugs
Donald Sharp [Mon, 23 Apr 2018 12:26:33 +0000 (08:26 -0400)]
zebra: Add some information to redistribute debugs

When we are debugging add a bit of extra information
so we can know what we are redistributing to our peers

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: style last 3 changes
Quentin Young [Mon, 23 Apr 2018 02:32:49 +0000 (22:32 -0400)]
zebra: style last 3 changes

Fixup latent style issues in copied code.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: cleanup for zapi_msg.c split
Quentin Young [Mon, 23 Apr 2018 02:10:54 +0000 (22:10 -0400)]
zebra: cleanup for zapi_msg.c split

* Rename client_connect and client_close hooks to zapi_client_connect
  and zapi_client_close
* Remove some more unnecessary headers
* Fix a copy-paste error in zapi_msg.[ch] header comments
* Fix an inclusion comment in zserv.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: use hooks for client lifecycle callbacks
Quentin Young [Sun, 22 Apr 2018 21:03:52 +0000 (17:03 -0400)]
zebra: use hooks for client lifecycle callbacks

zserv.c was using hardcoded callbacks to clean up various components
when a client disconnected. Ergo zserv.c had to know about all these
unrelated components that it should not care about. We have hooks now,
let's use the proper thing instead.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: clean up zapi organization
Quentin Young [Sun, 22 Apr 2018 20:01:20 +0000 (16:01 -0400)]
zebra: clean up zapi organization

zserv.c has become something of a dumping ground for everything vaguely
related to ZAPI and really needs some love. This change splits out the
code fo building and consuming ZAPI messages into a separate source
file, leaving the actual session and client lifecycle code in zserv.c.

Unfortunately since the #include situation in Zebra has not been paid
much attention I was forced to fix the headers in a lot of other source
files. This is a net improvement overall though.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: table.h needs to include prefix.h
Quentin Young [Sun, 22 Apr 2018 21:06:00 +0000 (17:06 -0400)]
lib: table.h needs to include prefix.h

For the last six years this source file has been using a type defined in
a header it did not include.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add ability to dump cli mode graph
Quentin Young [Fri, 20 Apr 2018 18:34:46 +0000 (14:34 -0400)]
lib: add ability to dump cli mode graph

The grammar sandbox has had the ability to dump individual commands as
DOT graphs, but now that generalized DOT support is present it's trivial
to extend this to entire submodes. This is quite useful for visualizing
the CLI space when debugging CLI errors.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add DFS + DOT dumping to graph datastructure
Quentin Young [Thu, 19 Apr 2018 15:35:16 +0000 (11:35 -0400)]
lib: add DFS + DOT dumping to graph datastructure

* Add general-purpose DFS traversal code
* Add ability to dump any graph to DOT language
* Add tests for graph datastructure

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix data race in thread history collection
Quentin Young [Fri, 20 Apr 2018 21:27:16 +0000 (17:27 -0400)]
lib: fix data race in thread history collection

Thread statistics are collected and stored in a hashtable shared across
threads, but while the hashtable itself is protected by a mutex, the
records themselves were not being updated safely. Change all thread
history collection to use atomic operations.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: table.h needs to include prefix.h
Quentin Young [Sun, 22 Apr 2018 21:06:00 +0000 (17:06 -0400)]
lib: table.h needs to include prefix.h

For the last six years this source file has been using a type defined in
a header it did not include.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: bugfix: vpn-vrf leak: set origin bgp to origin vrf for vrf-vpn-vrf
G. Paul Ziemba [Sun, 22 Apr 2018 03:04:29 +0000 (20:04 -0700)]
bgpd: bugfix: vpn-vrf leak: set origin bgp to origin vrf for vrf-vpn-vrf

bgp route extra->bgp_orig for routes leaked vpn->vrf should be set
to original extra->bgp_orig if it is set, not vpn's bgp instance.

The initial leak is OK because it goes through a loopback path
in the vrf->vpn leaking code, but it is possible later re-leaks (e.g.,
if the destination vrf's leak configuration is changed) could
set the wrong extra->bgp_orig and break the route's nexthop.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agobgpd: The deletion of a bgp route does not need to send some data
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>
6 years agoospf6d: fix ospf6 asbr crash
Chirag Shah [Thu, 19 Apr 2018 19:26:20 +0000 (12:26 -0700)]
ospf6d: fix ospf6 asbr crash

Durig ospf6 instance cleanup all border routers
are removed from the db then external LSAs removal
from DB is triggered. During the time, external route
path would not be valid as brouters along with its
rechability have vanished.
For a given external route removal check if no more
paths available simple remove the route from route db.

Ticket:CM-20669
Testing Done:
Bring up ASBR configuration with ECMP paths to a route.
Bring down the ospf6 instance and validate route is removed
from the DB.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #2080 from qlyoung/docuser
Lou Berger [Sat, 21 Apr 2018 11:52:31 +0000 (07:52 -0400)]
Merge pull request #2080 from qlyoung/docuser

doc: spelling fixes

6 years agodoc: spelling fixes
Quentin Young [Tue, 17 Apr 2018 18:57:32 +0000 (14:57 -0400)]
doc: spelling fixes

* Run sphinxcontrib-spelling over docs
* Correct spelling errors
* Compile a dictionary for future spellchecking efforts

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix dynamic stack buffer overflow
Quentin Young [Fri, 20 Apr 2018 20:40:46 +0000 (16:40 -0400)]
lib: fix dynamic stack buffer overflow

oops

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2092 from dslicenc/import-table-change
Russ White [Fri, 20 Apr 2018 12:10:39 +0000 (08:10 -0400)]
Merge pull request #2092 from dslicenc/import-table-change

zebra: resolve issue when changing import-table route-map config

6 years agoMerge pull request #2086 from donaldsharp/zebra_capabilities
Russ White [Fri, 20 Apr 2018 12:06:54 +0000 (08:06 -0400)]
Merge pull request #2086 from donaldsharp/zebra_capabilities

zebra: Add pass up through zapi what zebra is capable of handling

6 years agoMerge pull request #2083 from LabNConsulting/working/master/bvl-routemap-defined
Russ White [Fri, 20 Apr 2018 12:05:22 +0000 (08:05 -0400)]
Merge pull request #2083 from LabNConsulting/working/master/bvl-routemap-defined

bgpd: vpn-vrf routemaps: no leak if named route-map not defined

6 years agoMerge pull request #2079 from qlyoung/exit-vrf-memes
Russ White [Fri, 20 Apr 2018 12:01:32 +0000 (08:01 -0400)]
Merge pull request #2079 from qlyoung/exit-vrf-memes

Always explicitly exit vrf contexts

6 years agoMerge pull request #2077 from donaldsharp/static_warn
Russ White [Fri, 20 Apr 2018 11:59:37 +0000 (07:59 -0400)]
Merge pull request #2077 from donaldsharp/static_warn

zebra: Leave some warning breadcrumbs

6 years agoMerge pull request #2072 from donaldsharp/blackhole_this
Russ White [Fri, 20 Apr 2018 11:58:03 +0000 (07:58 -0400)]
Merge pull request #2072 from donaldsharp/blackhole_this

zebra: Allow blackhole route deletion for prefixes

6 years agoMerge pull request #2057 from donaldsharp/fix_1916
Russ White [Fri, 20 Apr 2018 11:56:48 +0000 (07:56 -0400)]
Merge pull request #2057 from donaldsharp/fix_1916

Fix 1916

6 years agoMerge pull request #2051 from donaldsharp/PBRD_EXTRA
Russ White [Fri, 20 Apr 2018 11:54:30 +0000 (07:54 -0400)]
Merge pull request #2051 from donaldsharp/PBRD_EXTRA

Pbrd extra

6 years agoMerge pull request #2088 from ajones-rvbd/ajones-issue-2087
Donald Sharp [Fri, 20 Apr 2018 11:22:09 +0000 (07:22 -0400)]
Merge pull request #2088 from ajones-rvbd/ajones-issue-2087

alpine build docs: Document docker images and alpine packages

6 years agozebra: resolve issue when changing import-table route-map config
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>
6 years agolib: add DFS + DOT dumping to graph datastructure
Quentin Young [Thu, 19 Apr 2018 15:35:16 +0000 (11:35 -0400)]
lib: add DFS + DOT dumping to graph datastructure

* Add general-purpose DFS traversal code
* Add ability to dump any graph to DOT language
* Add tests for graph datastructure

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2084 from donaldsharp/move_mpls
Jafar Al-Gharaibeh [Wed, 18 Apr 2018 20:53:17 +0000 (15:53 -0500)]
Merge pull request #2084 from donaldsharp/move_mpls

Move mpls

6 years agoalpine build docs: Document docker images and alpine packages
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>
6 years agoMerge pull request #2082 from qlyoung/sa-fixes
Rafael Zalamena [Wed, 18 Apr 2018 17:22:08 +0000 (14:22 -0300)]
Merge pull request #2082 from qlyoung/sa-fixes

Even more static analysis fixes

6 years agopbrd: fix multiple unsafe string copies
Quentin Young [Tue, 17 Apr 2018 22:20:53 +0000 (18:20 -0400)]
pbrd: fix multiple unsafe string copies

Coverity #1467828
Coverity #1467827
Coverity #1467826
Coverity #1467825
Coverity #1467824
Coverity #1467823
Coverity #1467822

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove potential null dereference
Quentin Young [Tue, 17 Apr 2018 21:59:47 +0000 (17:59 -0400)]
pbrd: remove potential null dereference

Coverity #1467832

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove pbr-policy resource leak
Quentin Young [Tue, 17 Apr 2018 21:51:48 +0000 (17:51 -0400)]
pbrd: remove pbr-policy resource leak

Removing a non-existent pbr-policy caused a pbr_interface to leak.

Coverity #1467829

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove unsafe string copy
Quentin Young [Tue, 17 Apr 2018 20:55:59 +0000 (16:55 -0400)]
pbrd: remove unsafe string copy

A user could overflow the pbr_ifp->mapname buffer by entering a pbr-map
name longer than 100 characters.

Coverity #1467821
Coverity #1467821

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: avoid indexing with negative integer
Quentin Young [Tue, 17 Apr 2018 20:40:09 +0000 (16:40 -0400)]
bgpd: avoid indexing with negative integer

Coverity #1399286

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopimd: avoid writing to negative fd
Quentin Young [Tue, 17 Apr 2018 20:36:56 +0000 (16:36 -0400)]
pimd: avoid writing to negative fd

Coverty #1465483

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: avoid writing to negative fd
Quentin Young [Tue, 17 Apr 2018 20:34:25 +0000 (16:34 -0400)]
lib: avoid writing to negative fd

Coverity #1399341

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: Add pass up through zapi what zebra is capable of handling
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>
6 years agoMerge pull request #2078 from dslicenc/fix-import-table-fix
Rafael Zalamena [Wed, 18 Apr 2018 13:21:38 +0000 (10:21 -0300)]
Merge pull request #2078 from dslicenc/fix-import-table-fix

zebra: fix flaw in fix for import-table crash

6 years agolib, zebra: Move label conversion strings to lib
Donald Sharp [Wed, 18 Apr 2018 11:06:11 +0000 (07:06 -0400)]
lib, zebra: Move label conversion strings to lib

The mpls_label2str and mpls_str2label functions should not
be zebra exclusive functions.  Move them to lib/mpls.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, zebra: Move help string to appropriate header
Donald Sharp [Wed, 18 Apr 2018 11:00:12 +0000 (07:00 -0400)]
lib, zebra: Move help string to appropriate header

The MPLS_LABEL_HELPSTR belongs in lib/mpls.h in case
any other protocol wants to use it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: vpn-vrf routemaps: no leak if named route-map not defined
G. Paul Ziemba [Wed, 18 Apr 2018 05:30:38 +0000 (22:30 -0700)]
bgpd: vpn-vrf routemaps: no leak if named route-map not defined

given a configuration such as this:

    router bgp 7777 vrf A
address-family ipv4 unicast
    route-map vpn import FOO
    import vpn

or this:

    router bgp 7777 vrf A
address-family ipv4 unicast
    rd vpn export 1:3
    rt vpn export 1:100
    route-map vpn export FOO
    export vpn

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.

This changeset implements the correct behavior.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agoMerge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore
Donald Sharp [Tue, 17 Apr 2018 22:59:48 +0000 (18:59 -0400)]
Merge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore

bgpd: add basic support for ETI and ESI for BGP EVPN

6 years agolib: Handle if up/down and vrf enable/disable events
Donald Sharp [Tue, 10 Apr 2018 19:57:09 +0000 (15:57 -0400)]
lib: Handle if up/down and vrf enable/disable events

Properly notice when we get if up/down and vrf enable/disable
events and attempt to properly install nexthops as they
come in.

Ticket: CM20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Use proper decode function for interface
Donald Sharp [Tue, 10 Apr 2018 19:54:35 +0000 (15:54 -0400)]
pbrd: Use proper decode function for interface

Use a proper decode function for a interface state change.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Store nexthop information independently
Donald Sharp [Tue, 10 Apr 2018 13:23:34 +0000 (09:23 -0400)]
lib: Store nexthop information independently

Store Nexthop's as the incoming raw data.  This will allow
us to separate the act of inputting the cli from the
act of instantiating the cli.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Fix unused function
Donald Sharp [Tue, 10 Apr 2018 12:03:25 +0000 (08:03 -0400)]
pbrd: Fix unused function

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Allow pbr-policy add/removal to install/remove rules
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>
6 years agopbrd: don't collapse pbr debugs
Quentin Young [Tue, 3 Apr 2018 20:48:53 +0000 (16:48 -0400)]
pbrd: don't collapse pbr debugs

While compact, collapsing the various debugs into simply `debug pbr` if
all debugs are on is potentially confusing to users.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: move debug vty into pbr_vty.c
Quentin Young [Tue, 3 Apr 2018 20:46:11 +0000 (16:46 -0400)]
pbrd: move debug vty into pbr_vty.c

Dev docs say that CLI goes in _vty.c files

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd, zebra: Properly notice rule deletion
Donald Sharp [Mon, 9 Apr 2018 13:41:08 +0000 (09:41 -0400)]
pbrd, zebra: Properly notice rule deletion

When a rule is deleted properly notice it in pbr.

Ticket: CM-20394
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd, zebra: Fix multiple pbr-policy install
Donald Sharp [Fri, 6 Apr 2018 20:38:20 +0000 (16:38 -0400)]
pbrd, zebra: Fix multiple pbr-policy install

Somewhere along the way the ability to install multiple
pbr-policys for the same pbr-map was lost.

Add this back.  There is a limitation in that we are limited
to 64 interfaces per pbr-policy.

Ticket: CM-20429
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com>
6 years agopbrd: Fix installation and deletion in some cases
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>
6 years agopbrd: Prevent attempt at re-install for several scenarios
Donald Sharp [Fri, 30 Mar 2018 17:38:45 +0000 (13:38 -0400)]
pbrd: Prevent attempt at re-install for several scenarios

There exists several places we attempt to re-install the
same rule.  Figure out when we need to not make an attempt
at doing anything and do it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Tell rib_process to actually rethink pbr routes.
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>
6 years agolib: Clean up delete of a nexthop from a nexthop group
Donald Sharp [Wed, 28 Mar 2018 23:31:40 +0000 (19:31 -0400)]
lib: Clean up delete of a nexthop from a nexthop group

The delete was not properly deleting the nexthop from
the nexthop group and it was not properly setting the
nexthop's pointers to NULL.

Ticket: CM-20261
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.
Donald Sharp [Wed, 28 Mar 2018 22:23:27 +0000 (18:23 -0400)]
lib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.

Prevent the creation of a v6 LL nexthop that does not include an interface
for proper resolution.

Ticket: CM-20276
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2064 from donaldsharp/redistribute_limitation
Lou Berger [Tue, 17 Apr 2018 19:55:35 +0000 (15:55 -0400)]
Merge pull request #2064 from donaldsharp/redistribute_limitation

redristribute and access list

6 years agoMerge pull request #2071 from qlyoung/sa-fixes
Rafael Zalamena [Tue, 17 Apr 2018 19:22:36 +0000 (16:22 -0300)]
Merge pull request #2071 from qlyoung/sa-fixes

More static analyzer fixes

6 years agovtysh: remove exit-vrf for vtysh -m
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>
6 years agovtysh, zebra: print exit-vrf at end of vrf context
Quentin Young [Wed, 11 Apr 2018 15:23:23 +0000 (11:23 -0400)]
vtysh, zebra: print exit-vrf at end of vrf context

Need to explicitly exit this context otherwise we risk ambiguities
between global and vrf context commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospfd: use __func__ in ospf_te.c
Quentin Young [Tue, 17 Apr 2018 18:08:57 +0000 (14:08 -0400)]
ospfd: use __func__ in ospf_te.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>