]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoconfigure: Update version of software frr-5.0-dev
Martin Winter [Wed, 2 May 2018 14:24:47 +0000 (07:24 -0700)]
configure: Update version of software

Start of 5.0 development branch.
Update of configure.ac to reflect verison change

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #2157 from donaldsharp/zebra_zebra_zebra
Martin Winter [Wed, 2 May 2018 11:16:28 +0000 (04:16 -0700)]
Merge pull request #2157 from donaldsharp/zebra_zebra_zebra

zebra: Fix crash on *BSD

6 years agozebra: Fix crash on *BSD
Donald Sharp [Wed, 2 May 2018 03:24:53 +0000 (23:24 -0400)]
zebra: Fix crash on *BSD

The zns->ns pointer is not created until we get a callback
from the kernel that a ns exists.  This should potentially
fix a crash in the *BSD code path.

Fixes: #2152
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2148 from opensourcerouting/snapupdate
Lou Berger [Tue, 1 May 2018 16:15:42 +0000 (12:15 -0400)]
Merge pull request #2148 from opensourcerouting/snapupdate

Update SNAP Package to add EIGRP, Babel and PRD

6 years agoMerge pull request #2119 from qlyoung/fix-vtysh-no-write-config
Lou Berger [Tue, 1 May 2018 15:51:28 +0000 (11:51 -0400)]
Merge pull request #2119 from qlyoung/fix-vtysh-no-write-config

vtysh: fix failure to write config w/o watchfrr

6 years agoMerge pull request #2140 from donaldsharp/sharp_doc
Lou Berger [Tue, 1 May 2018 15:15:59 +0000 (11:15 -0400)]
Merge pull request #2140 from donaldsharp/sharp_doc

doc: Add some documentation for the sharp daemon

6 years agosnapcraft: Add PBR daemon to snap package
Martin Winter [Tue, 1 May 2018 01:53:18 +0000 (18:53 -0700)]
snapcraft: Add PBR daemon to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Add eigrp daemon to snap package
Martin Winter [Tue, 1 May 2018 01:29:16 +0000 (18:29 -0700)]
snapcraft: Add eigrp daemon to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Add babel daemon to snap package
Martin Winter [Tue, 1 May 2018 01:03:53 +0000 (18:03 -0700)]
snapcraft: Add babel daemon to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agobabeld: fix cli option to override config file (-f)
Martin Winter [Tue, 1 May 2018 01:02:27 +0000 (18:02 -0700)]
babeld: fix cli option to override config file (-f)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #2139 from donaldsharp/map
Renato Westphal [Tue, 1 May 2018 00:50:17 +0000 (21:50 -0300)]
Merge pull request #2139 from donaldsharp/map

Map

6 years agosnapcraft: Fix missing runtime lib dependencies
Martin Winter [Mon, 30 Apr 2018 23:45:31 +0000 (16:45 -0700)]
snapcraft: Fix missing runtime lib dependencies

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodoc: Add some documentation for the sharp daemon
Donald Sharp [Mon, 30 Apr 2018 00:35:02 +0000 (20:35 -0400)]
doc: Add some documentation for the sharp daemon

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2045 from LabNConsulting/working/master/nh-vrf-in-bgp-show
Renato Westphal [Mon, 30 Apr 2018 19:33:42 +0000 (16:33 -0300)]
Merge pull request #2045 from LabNConsulting/working/master/nh-vrf-in-bgp-show

bgpd: when showing routes, add nexthop vrf and announce-self flag

6 years agovtysh: fix failure to write config w/o watchfrr
Quentin Young [Wed, 25 Apr 2018 19:09:02 +0000 (15:09 -0400)]
vtysh: fix failure to write config w/o watchfrr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: Convert internal sequence number to int64_t
Donald Sharp [Sun, 29 Apr 2018 16:40:12 +0000 (12:40 -0400)]
lib: Convert internal sequence number to int64_t

With the usage of a 32 bit number as a integer, but storing
non-signed values in it, we have cases where numbers greater
than 2 billion are being read in and stored and used before
lower value numbers, which of course is awful and mean.

Fixes: #2126
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: convert plist data structures to using a bool
Donald Sharp [Sun, 29 Apr 2018 00:39:20 +0000 (20:39 -0400)]
lib: convert plist data structures to using a bool

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2134 from donaldsharp/zzz-top
Lou Berger [Sun, 29 Apr 2018 12:50:52 +0000 (08:50 -0400)]
Merge pull request #2134 from donaldsharp/zzz-top

Clean up some issues found

6 years agolib: Convert true/false values to bool
Donald Sharp [Sat, 28 Apr 2018 23:52:41 +0000 (19:52 -0400)]
lib: Convert true/false values to bool

route_maps are using some int's as true/false so
let's convert them over to a bool.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: when showing routes, add nexthop vrf and announce-self flag
G. Paul Ziemba [Mon, 9 Apr 2018 20:28:11 +0000 (13:28 -0700)]
bgpd: when showing routes, add nexthop vrf and announce-self flag

As part of recent vpn-vrf leaking changes, it is now possible for a
route to refer to a nexthop in a different vrf. There is also a new
route flag that means "when announcing this route, indicate myself
as the next-hop."

route_vty_out(): nexthops are appended with:

    "@VRFID" (where VRFID is the numerical vrf id) when different from
    the route's vrf;

    "<" when the route's BGP_INFO_ANNC_NH_SELF is set

This change also shows the route table's vrf id in the table header.

route_vty_out_detail(): show nexthop's vrf and announce-nh-self flag if
appropriate.

Both functions are also augmented to add json elements nhVrfId, nhVrfName,
and announceNexthopSelf as appropriate.

The intent of these changes is to make it easier to understand/debug
the relationship between a route and its nexthops.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years ago*: Move sharpd from developmental build to have to explicity enable it
Donald Sharp [Fri, 27 Apr 2018 19:18:41 +0000 (15:18 -0400)]
*: Move sharpd from developmental build to have to explicity enable it

sharpd has started to see some use from our field engineers as
well as people attempting to build/test their environments
as a way of easily injecting a large number of routes.

Modify configure.ac to move sharpd from a development build
option to having to explicity enable it via `--enable-sharpd=yes`
in order for it to be built.

This will allow those who want to build it, to build it without
having to use the development build option.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: Actually allow end users to not build pbrd
Donald Sharp [Fri, 27 Apr 2018 19:04:40 +0000 (15:04 -0400)]
*: Actually allow end users to not build pbrd

The building of pbrd from a configure compile option
was not properly setup.  This should do that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotools: Cleanup code to handle sharp and pbr a bit better
Donald Sharp [Fri, 27 Apr 2018 18:58:56 +0000 (14:58 -0400)]
tools: Cleanup code to handle sharp and pbr a bit better

The sharp and pbr protocols needed a bit more handling
to be 'right' from a start/stop perspective.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add PBR and SHARP handling
Donald Sharp [Fri, 27 Apr 2018 18:53:46 +0000 (14:53 -0400)]
zebra: Add PBR and SHARP handling

We are missing some handling of PBR and SHARP protocols
for netlink operations w/ the linux kernel.

Additionally add a bread crumb for new developers( or existing )
to know to fixup the rt_netlink.c when we start handling new
route types to hand to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2125 from qlyoung/fix-gcc-build-command-graph
Renato Westphal [Thu, 26 Apr 2018 19:47:15 +0000 (16:47 -0300)]
Merge pull request #2125 from qlyoung/fix-gcc-build-command-graph

lib: fix clippy build w/ gcc under certain configs

6 years agoMerge pull request #2120 from qlyoung/fix-stream-fifo-heap-corruption
Renato Westphal [Thu, 26 Apr 2018 16:37:25 +0000 (13:37 -0300)]
Merge pull request #2120 from qlyoung/fix-stream-fifo-heap-corruption

lib: fix heap corruption in stream_fifo_free

6 years agolib: fix clippy build w/ gcc under certain configs
Quentin Young [Thu, 26 Apr 2018 16:31:45 +0000 (12:31 -0400)]
lib: fix clippy build w/ gcc under certain configs

GCC's linker driver sometimes gets confused when building clippy.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2048 from donaldsharp/vrf_2_vrf
Lou Berger [Thu, 26 Apr 2018 15:43:18 +0000 (11:43 -0400)]
Merge pull request #2048 from donaldsharp/vrf_2_vrf

Vrf 2 vrf

6 years agolib: fix heap corruption in stream_fifo_free
Quentin Young [Wed, 25 Apr 2018 21:16:55 +0000 (17:16 -0400)]
lib: fix heap corruption in stream_fifo_free

When popping a stream from a stream_fifo, the stream->next pointer is
not NULL'd out. If this same stream is subsequently pushed onto a
stream_fifo (either the same one or a different one), because
stream_fifo's use tail insertion the ->next pointer is not updated and
thus will point to whatever the next stream in the first stream_fifo
was. stream_fifo_free does not check the count of the stream_fifo when
freeing its constituent elements, and instead walks the linked list.
Consequently it will continue walking into the first stream_fifo from
which the last stream was popped, freeing each stream contained there.
This leads to use-after-free errors.

This patch makes sure to set the ->next pointer to NULL when doing tail
insertion in stream_fifo_push and when popping a stream from a
stream_fifo.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: Prevent vrf 2 vrf route leaking from going offbox.
Donald Sharp [Wed, 25 Apr 2018 14:23:22 +0000 (10:23 -0400)]
bgpd: Prevent vrf 2 vrf route leaking from going offbox.

The vrf 2 vrf route leaking auto-derives RD and RT and
installs the routes into the appropriate vpn table.
These routes when a operator configured ipv[4|6] vpn
neighbors were showing up off box.  The RD and RT
values choosen are localy significant but globaly
useless and may cause confusion.

Put a special bit of code in to notice that we
should not be advertising these routes off box.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: Fixup doc for vrf-2-vrf as per suggestions in Review
Donald Sharp [Tue, 24 Apr 2018 14:21:29 +0000 (10:21 -0400)]
doc: Fixup doc for vrf-2-vrf as per suggestions in Review

Fixup the documentation to suggested changes from the Review.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix CI breakage
Donald Sharp [Fri, 20 Apr 2018 20:07:30 +0000 (16:07 -0400)]
bgpd: Fix CI breakage

This commit reverts part of ceb800e0edb9f8979cebb1e6be9497d787bee39c
as it was found to be causing issues in upstream CI.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Dissallow mixing of import vrf and vpn commands
Donald Sharp [Tue, 17 Apr 2018 14:37:55 +0000 (10:37 -0400)]
bgpd: Dissallow mixing of import vrf and vpn commands

Do not allow the import vrf commands to be mixed with
import vpn commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Eliminate loop over afi's for vpn vrf leaking commands
Donald Sharp [Tue, 17 Apr 2018 13:21:24 +0000 (09:21 -0400)]
bgpd: Eliminate loop over afi's for vpn vrf leaking commands

The loop over all afi's implies that these commands actually need
to loop over all afi's to check the vpn policy.  We know the
appropriate afi based upon the node we are in.  So just return
the correct afi to look at and then just apply it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: disallow importing a vrf into itself
Don Slice [Wed, 11 Apr 2018 20:41:43 +0000 (20:41 +0000)]
bgpd: disallow importing a vrf into itself

Prior to this fix, you could configure importing a vrf from inside
the same vrf.  This can lead to unexpected behavior in the leaking
process.  This fix disallows that behavior.

Ticket: CM-20539
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: fix crash on "no import vrf" if no default bgp instance
Don Slice [Wed, 11 Apr 2018 16:12:39 +0000 (16:12 +0000)]
bgpd: fix crash on "no import vrf" if no default bgp instance

Tripped over a crash running the cli_crawler that occurred when the
sequence was doing "import vrf NAME" and "no import vrf NAME" inside
a vrf but a default bgp instance had not been created.  This fix
auto-creates the default instance if the "import vrf NAME" is
entered and a default instance does not exist.

Ticket: CM-20532
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: fix import vrf route-map issues
Don Slice [Tue, 10 Apr 2018 15:00:18 +0000 (15:00 +0000)]
bgpd: fix import vrf route-map issues

Prior to this fix, the import vrf route-map command only worked
if the route-map existed prior to the command.  Additionally, if
the import vrf route-map command was issued without an existing
route-map, the imported prefixes were not removed.  This fix
resolves both of thes mis-behaviors. bgp-smoke run with same
failures as base.

Ticket: CM-20459
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-7358
6 years agobgpd: fix incorrect config when importing vrf default
Don Slice [Sun, 8 Apr 2018 15:35:21 +0000 (15:35 +0000)]
bgpd: fix incorrect config when importing vrf default

Found that when doing "import vrf default" in another vrf, an
extra line was added to the configuration in error.   This fix
resolves that incorrect configuration. Manual testing will be
attached to the defect.

Ticket: CM-20467
Signed-off-by: Don Slice <dslice@cumulustnetworks.com>
Reviewed by: Donald Sharp <sharpd@cumulusnetworks.com>

6 years agobgpd: add ability to import default vrf routes
Don Slice [Fri, 30 Mar 2018 20:44:39 +0000 (20:44 +0000)]
bgpd: add ability to import default vrf routes

signed-off-by: Don Slice <dslice@cumulusnetworks.com>

6 years agobgpd: Use correct memory type
Donald Sharp [Mon, 16 Apr 2018 14:49:45 +0000 (10:49 -0400)]
bgpd: Use correct memory type

The usage of MTYPE_ECOMMUNITY for the free in ecommunity_del_val
caused the ref counts for the ecommunity to be incorrect.
Use MTYPE_ECOMMUNITY_VAL since that is what we are deleting.

Ticket: CM-20602
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Cleanup lines over 80 columns
Donald Sharp [Thu, 12 Apr 2018 12:59:08 +0000 (08:59 -0400)]
bgpd: Cleanup lines over 80 columns

There were a couple of instances of code extending
beyond 80 columns, clean it up with clang-format.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Add some vrf <-> vrf code comments
Donald Sharp [Tue, 17 Apr 2018 12:21:03 +0000 (08:21 -0400)]
bgpd: Add some vrf <-> vrf code comments

Note that when we are importing vrf EVA into vrf DONNA
we must keep track of all the vrfs EVA is being
exported into and we must also keep track of all the vrf's
that DONNA is receiving data from as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix SA warning found by clang.
Donald Sharp [Wed, 11 Apr 2018 16:41:55 +0000 (12:41 -0400)]
bgpd: Fix SA warning found by clang.

Quiet the SA warning, with an assert.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Cleanup warnings found in CI
Donald Sharp [Wed, 11 Apr 2018 13:40:50 +0000 (09:40 -0400)]
bgpd: Cleanup warnings found in CI

Cleanup some of the warnings found in the CI system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix data type
Donald Sharp [Wed, 11 Apr 2018 13:34:40 +0000 (09:34 -0400)]
bgpd: Fix data type

The data type for a variable in bgp_ecommunity.c was
a non-standard type and was causing build failures
on some more obscure build targets.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: Update VRF 2 VRF route leaking documentation for bgp
Donald Sharp [Wed, 11 Apr 2018 13:31:22 +0000 (09:31 -0400)]
doc: Update VRF 2 VRF route leaking documentation for bgp

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix memory leak on shutdown
Donald Sharp [Wed, 11 Apr 2018 13:20:19 +0000 (09:20 -0400)]
bgpd: Fix memory leak on shutdown

When we remove a bgp instance cleanup the
import_vrf and export_vrf lists.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>