]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agozebra,ldpd: use zapi client session id in LM apis
Mark Stapp [Wed, 15 Apr 2020 12:34:03 +0000 (08:34 -0400)]
zebra,ldpd: use zapi client session id in LM apis

Use the zapi client session id in the label manager apis;
use the client struct directly in some code. Assign a session
id to ldpd's sync LM zapi session.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib,zebra: add a session id for zapi sessions
Mark Stapp [Tue, 14 Apr 2020 14:45:09 +0000 (10:45 -0400)]
lib,zebra: add a session id for zapi sessions

Distinguish zapi sessions, for daemons who use more than one,
by adding a session id. The tuple of proto + instance is not
adequate to support clients who use multiple zapi sessions.
Include the id in the client show output if it's present. Add
a bit of info about this to the developer doc.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #6154 from donaldsharp/check_interface_working
Renato Westphal [Wed, 15 Apr 2020 02:37:47 +0000 (23:37 -0300)]
Merge pull request #6154 from donaldsharp/check_interface_working

tests: Add a route-map test to ensure it accepts an unknown intf name

4 years agoMerge pull request #6225 from qlyoung/fix-zebra-counter-printf-specifiers
Renato Westphal [Wed, 15 Apr 2020 00:03:09 +0000 (21:03 -0300)]
Merge pull request #6225 from qlyoung/fix-zebra-counter-printf-specifiers

zebra: use %u for unsigned when printing counters

4 years agoMerge pull request #6214 from opensourcerouting/bfdd-debug
Donald Sharp [Tue, 14 Apr 2020 23:06:10 +0000 (19:06 -0400)]
Merge pull request #6214 from opensourcerouting/bfdd-debug

bfdd: code/logging/debug improvements

4 years agoMerge pull request #6211 from mjstapp/fix_zebra_cov
Quentin Young [Tue, 14 Apr 2020 22:25:38 +0000 (18:25 -0400)]
Merge pull request #6211 from mjstapp/fix_zebra_cov

zebra: fix some coverity SA warnings

4 years agoMerge pull request #5510 from opensourcerouting/dplane-fpm-netlink
Mark Stapp [Tue, 14 Apr 2020 20:40:05 +0000 (16:40 -0400)]
Merge pull request #5510 from opensourcerouting/dplane-fpm-netlink

zebra: netlink FPM interface using zebra data plane

4 years agozebra: use %u for unsigned when printing counters
Quentin Young [Tue, 14 Apr 2020 19:02:30 +0000 (15:02 -0400)]
zebra: use %u for unsigned when printing counters

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5812 from pguibert6WIND/bgp_stats_all
Donald Sharp [Tue, 14 Apr 2020 18:36:21 +0000 (14:36 -0400)]
Merge pull request #5812 from pguibert6WIND/bgp_stats_all

Bgp stats all

4 years agoMerge pull request #6218 from qlyoung/fix-ospf-router-lsa-missing-length-check
Olivier Dugeon [Tue, 14 Apr 2020 17:49:53 +0000 (19:49 +0200)]
Merge pull request #6218 from qlyoung/fix-ospf-router-lsa-missing-length-check

ospfd: router LSA link info missing length check

4 years agozebra: fix hash_backet typo in data plane FPM
Rafael Zalamena [Mon, 23 Mar 2020 17:06:41 +0000 (14:06 -0300)]
zebra: fix hash_backet typo in data plane FPM

Implement the fix made in `master` to the remain pieces of code in the
data plane FPM module.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: hide verbose data plane FPM log messages
Rafael Zalamena [Tue, 11 Feb 2020 13:46:01 +0000 (10:46 -0300)]
zebra: hide verbose data plane FPM log messages

To enable them just configure `debug zebra fpm`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: fix some formatting/style issues
Rafael Zalamena [Mon, 10 Feb 2020 21:40:43 +0000 (18:40 -0300)]
zebra: fix some formatting/style issues

* Break lines longer than 80 columns.
* Remove space after '('.
* Use '%pIX' instead of 'inet_ntop'.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: data plane FPM add support RMAC VNI
Rafael Zalamena [Mon, 13 Jan 2020 19:34:03 +0000 (16:34 -0300)]
zebra: data plane FPM add support RMAC VNI

Store VNI information in the data plane context so we can use it to
build the FPM netlink update with that information later.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: fix style on data plane FPM module
Rafael Zalamena [Wed, 8 Jan 2020 19:31:23 +0000 (16:31 -0300)]
zebra: fix style on data plane FPM module

*   Use 32bit atomic instead of 64bit.
*   Don't use semicolon at the end of macros.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobuild: fix data plane FPM netlink module
Rafael Zalamena [Fri, 3 Jan 2020 20:22:27 +0000 (17:22 -0300)]
build: fix data plane FPM netlink module

Changes:

*   Let the package builder scripts know that we have a new module that
    needs to be taken care of.
*   Include the frr atomic header to avoid undeclared atomic operations.
*   Disable build on *BSDs because the code is using some zebra netlink
    functions only available for Linux.
*   Move data plane FPM module outside old FPM automake definition.
*   Fix atomic usage for Ubuntu 14.04 (always use explicit).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: use atomic operations in FPM
Rafael Zalamena [Tue, 17 Dec 2019 13:03:54 +0000 (10:03 -0300)]
zebra: use atomic operations in FPM

FPM has a thread to encode and enqueue output buffer that might compete
with zebra RIB/RMAC walk on startup, so lets use atomic operations to
make sure we are not getting statistic/counters wrong.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: queue data plane context for FPM
Rafael Zalamena [Thu, 12 Dec 2019 18:04:23 +0000 (15:04 -0300)]
zebra: queue data plane context for FPM

Enqueue all contexts inside FPM to avoid losing updates and to move all
processing to the FPM thread.

This helps in situations with huge amount of routes (e.g. BGP peer
flapping with a million routes).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: improve FPM output buffer handling
Rafael Zalamena [Thu, 12 Dec 2019 13:11:28 +0000 (10:11 -0300)]
zebra: improve FPM output buffer handling

Add counters to debug the output buffer usage and pull down its data
when the remote receiver is slow (so we get more space for writes).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: simplify FPM buffer full detection
Rafael Zalamena [Wed, 11 Dec 2019 21:04:50 +0000 (18:04 -0300)]
zebra: simplify FPM buffer full detection

Remove code duplication and document hardcoded values.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: implement FPM counters
Rafael Zalamena [Wed, 11 Dec 2019 16:59:42 +0000 (13:59 -0300)]
zebra: implement FPM counters

Add commands to show and reset FPM counters.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: CLI commands for new FPM interface
Rafael Zalamena [Tue, 10 Dec 2019 20:10:10 +0000 (17:10 -0300)]
zebra: CLI commands for new FPM interface

Add commands to enable/disable and configure FPM.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: data plane FPM RMAC walk code
Rafael Zalamena [Mon, 9 Dec 2019 15:37:35 +0000 (12:37 -0300)]
zebra: data plane FPM RMAC walk code

Implement the code that walks the RMAC to send routes that are already
inside installed in the OS.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: adapt and export rmac netlink functions
Rafael Zalamena [Mon, 9 Dec 2019 15:36:18 +0000 (12:36 -0300)]
zebra: adapt and export rmac netlink functions

Those functions are going to be used by the new data plane plugin for
netlink FPM.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #6197 from sworleys/PBR-Atomic
Russ White [Tue, 14 Apr 2020 15:58:54 +0000 (11:58 -0400)]
Merge pull request #6197 from sworleys/PBR-Atomic

pbrd,zebra: implement `set *` and `match *` replace

4 years agoMerge pull request #6096 from pjdruddy/vxlan_evpn_topo_test
Donald Sharp [Tue, 14 Apr 2020 15:53:48 +0000 (11:53 -0400)]
Merge pull request #6096 from pjdruddy/vxlan_evpn_topo_test

tests: add basic topotest for VXLAN EVPN

4 years agoospfd: router LSA link info missing length check
Quentin Young [Tue, 14 Apr 2020 04:39:15 +0000 (00:39 -0400)]
ospfd: router LSA link info missing length check

Fix
- Modulo check on data length not inclusive enough
- Garbage heap read when bounds checking

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agopbrd: fix wording in pbr_send_pbr_map comment
Stephen Worley [Tue, 14 Apr 2020 15:09:54 +0000 (11:09 -0400)]
pbrd: fix wording in pbr_send_pbr_map comment

Fix some bad wording in a comment when deciding whether
to send a pbr map sequence to zebra.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: data plane FPM RIB walk code
Rafael Zalamena [Wed, 4 Dec 2019 18:07:11 +0000 (15:07 -0300)]
zebra: data plane FPM RIB walk code

Implement the code that walks the RIB to send routes that are already
inside the RIB.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: data plane plugin for FPM netlink
Rafael Zalamena [Wed, 4 Dec 2019 13:39:18 +0000 (10:39 -0300)]
zebra: data plane plugin for FPM netlink

Initial import of the new zebra data plane plugin for FPM netlink.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: dataplane context reset and init apis
Mark Stapp [Tue, 10 Dec 2019 19:53:46 +0000 (14:53 -0500)]
zebra: dataplane context reset and init apis

Add a public reset api, so a context can be reset and reused;
add apis to init a context for a route or mac update.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agozebra: export netlink function and change return
Rafael Zalamena [Wed, 4 Dec 2019 13:37:40 +0000 (10:37 -0300)]
zebra: export netlink function and change return

Instead of retuning always `0`, lets return the amount of used bytes for
the message. This will be used by the new FPM interface to know how many
bytes we must reserve for the output buffer.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: simplify netlink_route_multipath
Rafael Zalamena [Mon, 2 Dec 2019 16:03:35 +0000 (13:03 -0300)]
zebra: simplify netlink_route_multipath

*   Remove variable `family`;
*   Remove always false `RTM_DELROUTE` checks;

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: simplify some netlink debug messages
Rafael Zalamena [Fri, 29 Nov 2019 21:15:02 +0000 (18:15 -0300)]
zebra: simplify some netlink debug messages

*   Use `inet_ntop` instead of `inet_ntoa`
*   Replace function name with `__func__`
*   Inline functions

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agozebra: generalize netlink route talk function
Rafael Zalamena [Fri, 29 Nov 2019 18:19:47 +0000 (15:19 -0300)]
zebra: generalize netlink route talk function

Generalize the netlink route message building function so it can be used
in the future by the netlink Forwarding Plane Manager (FPM) interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #6201 from adharkar/frr-master-fpm_mac
Russ White [Tue, 14 Apr 2020 13:30:47 +0000 (09:30 -0400)]
Merge pull request #6201 from adharkar/frr-master-fpm_mac

zebra: Address sequencing issue while sending RMAC via FPM

4 years agoMerge pull request #6219 from qlyoung/fix-ospf-opaque-so-lsa-uaf
Russ White [Tue, 14 Apr 2020 13:18:38 +0000 (09:18 -0400)]
Merge pull request #6219 from qlyoung/fix-ospf-opaque-so-lsa-uaf

ospfd: fix uaf upon rx of self-originated lsa

4 years agoMerge pull request #6221 from opensourcerouting/defaults-fix-version-cmp
Donatas Abraitis [Tue, 14 Apr 2020 13:01:21 +0000 (16:01 +0300)]
Merge pull request #6221 from opensourcerouting/defaults-fix-version-cmp

lib/defaults: fix version number comparison

4 years agoMerge pull request #6011 from patrasar/pim-no-msdp-group-cmd
Donald Sharp [Tue, 14 Apr 2020 12:35:09 +0000 (08:35 -0400)]
Merge pull request #6011 from patrasar/pim-no-msdp-group-cmd

pimd: added no ip msdp mesh-group <word>

4 years agodoc: update BFD debugging section
Rafael Zalamena [Mon, 13 Apr 2020 19:34:11 +0000 (16:34 -0300)]
doc: update BFD debugging section

Show more information about BFD debug feature.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agotopotest: enable bfd debugs on all BFD tests
Rafael Zalamena [Mon, 13 Apr 2020 19:01:34 +0000 (16:01 -0300)]
topotest: enable bfd debugs on all BFD tests

Lets attempt to get the most out of the debug messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: add more zebra debug messages
Rafael Zalamena [Mon, 13 Apr 2020 18:22:13 +0000 (15:22 -0300)]
bfdd: add more zebra debug messages

Uncomment old debug about relayed messages from zebra.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: constify satostr
Rafael Zalamena [Mon, 13 Apr 2020 18:18:17 +0000 (15:18 -0300)]
bfdd: constify satostr

Detect modifications to the `sockaddr_any` struct.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: remove time calculation debugs
Rafael Zalamena [Mon, 13 Apr 2020 18:17:31 +0000 (15:17 -0300)]
bfdd: remove time calculation debugs

These were disabled by default and not used by a long time.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: simplify code flow
Rafael Zalamena [Mon, 13 Apr 2020 17:23:03 +0000 (14:23 -0300)]
bfdd: simplify code flow

Don't attempt to handle out-of-memory situations: XMALLOC/XCALLOC will
`assert` if there is no memory left.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: add debug fine tuning capabilities
Rafael Zalamena [Mon, 13 Apr 2020 10:36:23 +0000 (07:36 -0300)]
bfdd: add debug fine tuning capabilities

Move most of the log messages to debug guards so they only get activated
if the user configured the proper debug level.

Current debug levels:
- Peer events.
- Zebra events.
- Network layer debugs.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #6017 from sarav511/ovrride
Donald Sharp [Tue, 14 Apr 2020 12:32:32 +0000 (08:32 -0400)]
Merge pull request #6017 from sarav511/ovrride

pimd: Join not sent within prune override time when received non local prune

4 years agoMerge pull request #6196 from dslicenc/ospf6d-brouter-loop
David Lamparter [Tue, 14 Apr 2020 12:12:17 +0000 (14:12 +0200)]
Merge pull request #6196 from dslicenc/ospf6d-brouter-loop

ospf6d: stop looping thru same Inter-Area Router LSAs

4 years agozebra: fix some coverity SA warnings
Mark Stapp [Mon, 13 Apr 2020 14:25:48 +0000 (10:25 -0400)]
zebra: fix some coverity SA warnings

Fix several coverity scan warnings.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib/defaults: don't use "static" in a weird way
David Lamparter [Tue, 14 Apr 2020 11:23:57 +0000 (13:23 +0200)]
lib/defaults: don't use "static" in a weird way

This didn't break anything but it's not really correct either.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agolib/defaults: more bool confusion
David Lamparter [Tue, 14 Apr 2020 11:22:38 +0000 (13:22 +0200)]
lib/defaults: more bool confusion

Sigh.  Initializing a bool to -1 gives 1.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoMerge pull request #5988 from xThaid/zebra_vrf_logs
David Lamparter [Tue, 14 Apr 2020 10:52:31 +0000 (12:52 +0200)]
Merge pull request #5988 from xThaid/zebra_vrf_logs

zebra: Add vrf name and id to debugs

4 years agoMerge pull request #6215 from vivek-cumulus/wtecmp_linkbw_doc
David Lamparter [Tue, 14 Apr 2020 10:45:12 +0000 (12:45 +0200)]
Merge pull request #6215 from vivek-cumulus/wtecmp_linkbw_doc

doc: Documentation for weighted ECMP and link bandwidth

4 years agoospfd: fix uaf upon rx of self-originated lsa
Quentin Young [Tue, 14 Apr 2020 05:43:13 +0000 (01:43 -0400)]
ospfd: fix uaf upon rx of self-originated lsa

ospf_opaque_self_originated_lsa_received decrements refcount which can
result in a free, this is followed by a call to ospf_ls_ack_send which
accesses the freed LSA

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agodoc: Documentation for weighted ECMP and link bandwidth
vivek [Tue, 14 Apr 2020 03:20:19 +0000 (20:20 -0700)]
doc: Documentation for weighted ECMP and link bandwidth

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agoMerge pull request #5892 from qlyoung/fix-zclient-many
Renato Westphal [Tue, 14 Apr 2020 01:48:28 +0000 (22:48 -0300)]
Merge pull request #5892 from qlyoung/fix-zclient-many

assorted lib / zclient fixes

4 years agolib: fix SA warning in vrf creation zapi handler
Quentin Young [Mon, 13 Apr 2020 17:24:51 +0000 (13:24 -0400)]
lib: fix SA warning in vrf creation zapi handler

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: fix if_set_value
Quentin Young [Wed, 8 Apr 2020 20:29:23 +0000 (16:29 -0400)]
lib: fix if_set_value

Something in there is wrong and causing test failures. Moving it back to
how it was; we'll stil assert if the message was wrong, just in a
different place now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: work around enum issue in old gcc
Quentin Young [Tue, 24 Mar 2020 17:16:06 +0000 (13:16 -0400)]
lib: work around enum issue in old gcc

I'd like to keep the explicit check here, but since underlying type of
enum is implementation defined, theres some inconsistency using -Wall
-Werror in older compilers here

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6213 from ton31337/fix/moar_bool_stuff
Quentin Young [Mon, 13 Apr 2020 18:11:23 +0000 (14:11 -0400)]
Merge pull request #6213 from ton31337/fix/moar_bool_stuff

bgpd: Replace 0 to false for bool assignment in bgp_update_martian_ne…

4 years agoMerge pull request #6210 from donaldsharp/sharp_labels
Mark Stapp [Mon, 13 Apr 2020 17:56:03 +0000 (13:56 -0400)]
Merge pull request #6210 from donaldsharp/sharp_labels

sharpd: Allow sharpd to specify it's own routes for label changes

4 years agobgpd: Replace 0 to false for bool assignment in bgp_update_martian_nexthop()
Donatas Abraitis [Mon, 13 Apr 2020 17:39:31 +0000 (20:39 +0300)]
bgpd: Replace 0 to false for bool assignment in bgp_update_martian_nexthop()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agolib: re-add accidentally deleted pfx family set
Quentin Young [Tue, 24 Mar 2020 15:38:19 +0000 (11:38 -0400)]
lib: re-add accidentally deleted pfx family set

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: improve sanity check on vrf backend value
Quentin Young [Wed, 18 Mar 2020 16:00:38 +0000 (12:00 -0400)]
lib: improve sanity check on vrf backend value

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: handle failure to change ifindex
Quentin Young [Mon, 2 Mar 2020 23:50:58 +0000 (18:50 -0500)]
lib: handle failure to change ifindex

This fixes a theoretical bug that could occur when trying to change an
ifindex on an interface to that of an existing interface. We would
remove the interface from the ifindex tree, and change the ifindex, but
when we tried to reinsert the interface, the insert would fail. It was
impossible to know if this failed due to the insertion / deletion macros
capturing the result value of the underlying BSD tree macros. So we
would effectively delete the interface.

Instead of failing on insert, we just check if the prospective ifindex
already exists and return -1 if it does.

Macros have been changed to statement expressions so the result can be
checked, and bubbled up.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: more zclient fixes; str termination, vrfs...
Quentin Young [Mon, 2 Mar 2020 23:47:11 +0000 (18:47 -0500)]
lib: more zclient fixes; str termination, vrfs...

* Don't crash if we get a request to create an existing VRF
* Ensure interface & vrf names are null terminated...again

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: don't crash on iface add for unknown vrf
Quentin Young [Sun, 1 Mar 2020 22:44:12 +0000 (17:44 -0500)]
lib: don't crash on iface add for unknown vrf

If Zebra sends us an interface add notification with a garbage VRF we
crash on an assert(vrf_get(vrf_id, NULL)); let's not

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: ensure iface name is null terminated
Quentin Young [Sun, 1 Mar 2020 22:43:53 +0000 (17:43 -0500)]
lib: ensure iface name is null terminated

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: handle bogus VRF backend type
Quentin Young [Mon, 2 Mar 2020 23:42:56 +0000 (18:42 -0500)]
lib: handle bogus VRF backend type

And use an enum...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: make all zclient.[ch] stream funcs safe
Quentin Young [Sun, 1 Mar 2020 06:21:56 +0000 (01:21 -0500)]
lib: make all zclient.[ch] stream funcs safe

Use STREAM_GET* variants of stream getters, which all have non-assert
error paths.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: add STREAM_GETQ, STREAM_GETF
Quentin Young [Sun, 1 Mar 2020 06:20:40 +0000 (01:20 -0500)]
lib: add STREAM_GETQ, STREAM_GETF

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: remove unnecessary null checks
Quentin Young [Sun, 1 Mar 2020 06:19:55 +0000 (01:19 -0500)]
lib: remove unnecessary null checks

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6209 from donaldsharp/true_false
Mark Stapp [Mon, 13 Apr 2020 16:17:19 +0000 (12:17 -0400)]
Merge pull request #6209 from donaldsharp/true_false

bgpd: bools use `true/false` not `TRUE/FALSE`

4 years agosharpd: Allow sharpd to specify it's own routes for label changes
Donald Sharp [Mon, 13 Apr 2020 12:12:26 +0000 (08:12 -0400)]
sharpd: Allow sharpd to specify it's own routes for label changes

With the command using STR_SHARP, the sharp daemon is not allowed
to use it's own routes for label modification.  Switching over
to STR_ZEBRA allows the sharp daemon to modify labels on any
route in the system, since there are no `ROUTE_ZEBRA` types.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: bools use `true/false` not `TRUE/FALSE`
Donald Sharp [Mon, 13 Apr 2020 12:08:48 +0000 (08:08 -0400)]
bgpd: bools use `true/false` not `TRUE/FALSE`

Who knows where these values were coming from.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: added no ip msdp mesh-group <word>
Sarita Patra [Mon, 16 Mar 2020 20:41:46 +0000 (13:41 -0700)]
pimd: added no ip msdp mesh-group <word>

Issue: no ip msdp mesh-group <word> source command
deleting the mesh group, which might be used by the member.

Solution: no ip msdp mesh-group <word> source command, deletes
the mesh-group source.
Add a new cli command "no ip msdp mesh-group <word>" to delete
the mesh group.

Signed-off-by: Sarita Patra <saritap@vmware.com>
4 years agoMerge pull request #6199 from opensourcerouting/bfdd-improvements
Donald Sharp [Mon, 13 Apr 2020 00:28:35 +0000 (20:28 -0400)]
Merge pull request #6199 from opensourcerouting/bfdd-improvements

bfdd: misc code improvements and fixes

4 years agoMerge pull request #6204 from opensourcerouting/fix-eigrp-neighbor
Donald Sharp [Mon, 13 Apr 2020 00:25:26 +0000 (20:25 -0400)]
Merge pull request #6204 from opensourcerouting/fix-eigrp-neighbor

yang: use the correct type for EIGRP neighbors

4 years agozebra: Add vrf name and id to debugs
Jakub Urbańczyk [Sun, 15 Mar 2020 18:42:30 +0000 (19:42 +0100)]
zebra: Add vrf name and id to debugs

In some places we log the interface but not the vfr the
interface is in. In others we only output the vrf id, which
can be difficult for human to read. This commit makes zebra
debugs more vrf aware.

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
4 years agoyang: use the correct type for EIGRP neighbors
Renato Westphal [Sun, 12 Apr 2020 03:12:19 +0000 (00:12 -0300)]
yang: use the correct type for EIGRP neighbors

Fixes #6193.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #6181 from volta-networks/fix_isisd_no_metric_style
Renato Westphal [Sun, 12 Apr 2020 02:29:28 +0000 (23:29 -0300)]
Merge pull request #6181 from volta-networks/fix_isisd_no_metric_style

isisd: fix two 'no X' commands

4 years agozebra: Address sequencing issue while sending RMAC via FPM
Ameya Dharkar [Sat, 11 Apr 2020 00:59:31 +0000 (17:59 -0700)]
zebra: Address sequencing issue while sending RMAC via FPM

Issue:
For consecutive messages such as
MAC1 -> VTEP1 add
MAC1 -> VTEP2 add
MAC1 -> VTEP1 add

Final state, i.e. (MAC1 -> VTEP1 add) should be sent via FPM.
But, with current code, FPM will send (MAC1 -> VTEP2 add)

RCA:
When FPM receives (MAC1, VTEP1), it stores it in the FPM processing queue and
hash table.

When FPM receives (MAC1, VTEP2), this entry is stored as another node as hash
table key is (mac, vtep and vni)

IF FPM again receives (MAC1, VTEP1), we fetch this node in the hash table
which is already enqueued.

When the FPM queue is processed, we will send FPM message for (MAC1, VTEP1)
first and then for (MAC1, VTEP2)

This sequencing issue happened because the key of the table is (MAC, VTEP, VNI)

Fix:
Change the key of the hash table to (MAC, VNI)
So, every time we receive a new update for (MAC1, VNI1), we will find a node in
the processing queue corresponding to MAC1 if present.
We will update this same node for every operation related to (MAC1, VNI1)

Thus, at the time when FPM processes this node, it will have latest MAC1 info.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
4 years agoMerge pull request #6027 from sarav511/vrfloop
Donald Sharp [Fri, 10 Apr 2020 18:02:28 +0000 (14:02 -0400)]
Merge pull request #6027 from sarav511/vrfloop

pimd: crash while finding primary address.

4 years agoMerge pull request #6176 from NaveenThanikachalam/memleaks
Quentin Young [Fri, 10 Apr 2020 17:55:52 +0000 (13:55 -0400)]
Merge pull request #6176 from NaveenThanikachalam/memleaks

bgpd: Fixes for memory leaks.

4 years agozebra: read in and sweep rules on startup
Stephen Worley [Wed, 8 Apr 2020 23:10:24 +0000 (19:10 -0400)]
zebra: read in and sweep rules on startup

On startup of zebra, read in all ipv4/ipv6 rules from
the kernel and remove any with the zebra proto.

If there are any, this means we failed to remove them
on shutdown due to a crash or something. Without this,
users have to manually remove them with iproute2 or some
such and its really annoying.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agobfdd: use standard log macros
Rafael Zalamena [Fri, 10 Apr 2020 14:06:22 +0000 (11:06 -0300)]
bfdd: use standard log macros

Remove old log_* macros and standardize on FRR's logging infrastructure.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #6189 from vivek-cumulus/unequal_cost_multipath_fixes
Russ White [Fri, 10 Apr 2020 13:03:50 +0000 (09:03 -0400)]
Merge pull request #6189 from vivek-cumulus/unequal_cost_multipath_fixes

Unequal cost multipath fixes

4 years agozebra: set family on read in rule prefix
Stephen Worley [Wed, 8 Apr 2020 23:09:29 +0000 (19:09 -0400)]
zebra: set family on read in rule prefix

We were not setting the family for the prefix on the src/dst
IP of the rule.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agobfdd: fix transmission timer calculation
Rafael Zalamena [Thu, 9 Apr 2020 20:46:02 +0000 (17:46 -0300)]
bfdd: fix transmission timer calculation

According to the RFC 5880 the transmission time should be mandated by
the slowest system.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: initialize packet data with zeroes
Rafael Zalamena [Thu, 9 Apr 2020 20:44:56 +0000 (17:44 -0300)]
bfdd: initialize packet data with zeroes

Lets avoid garbage data on packets by zeroing the packet before setting
the fields/flags.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: remove BFD_*_FLAG macros
Rafael Zalamena [Thu, 9 Apr 2020 19:52:49 +0000 (16:52 -0300)]
bfdd: remove BFD_*_FLAG macros

Lets use what FRR provide us instead of implementing a new macros.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoospf6d: stop looping thru same Inter-Area Router LSAs
Don Slice [Thu, 2 Apr 2020 17:50:53 +0000 (17:50 +0000)]
ospf6d: stop looping thru same Inter-Area Router LSAs

Processing loop uncovered when there are multiple ABRs also
acting as ASBRs into the same area in ospf6.  The problem
was that when looking thru the list of Inter-area router
entries, if the current entry being processed matched, it
still merged next-hops and re-initiated the process.  In
this fix, if the route/path matches and the next-hops also
match, there is no need to re-initiate the examine process.

Ticket: CM-28900
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agopbrd: separate `set *` and `no set *` commands
Stephen Worley [Tue, 7 Apr 2020 20:53:52 +0000 (16:53 -0400)]
pbrd: separate `set *` and `no set *` commands

Separate out the `set *` and `no set *` commands into
different DEFPYs to make the logic of the code easier to
read.

Further, allow non-exlpicit no commands.

So `no set nexthop`, `no set nexthop-group`, and
`no set vrf` will now work without having to specify
anymore data. Before you had to match what was already
there explicitly.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: implement `set *` and `match *` config replacement
Stephen Worley [Wed, 18 Dec 2019 21:11:39 +0000 (16:11 -0500)]
pbrd: implement `set *` and `match *` config replacement

Implement the ability to replace any existing `set *` or
`match` with another one or adding more config without having
to first delete the original config already there.

Before, we needed to constantly execute a `no` command for everything
to remove the rule before making changes to it. With this
patch, you can replace configs on individual sequences much
easier.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: free nexthop_group name on `no set nexthop-group`
Stephen Worley [Mon, 6 Apr 2020 18:13:20 +0000 (14:13 -0400)]
pbrd: free nexthop_group name on `no set nexthop-group`

Properly free the string pointed to by `pbrms->nhgrp_name`
when we are removiing the config for a nexthop group
on a pbr map sequence.

Found via memleak:
==3152214== 4 bytes in 1 blocks are definitely lost in loss record 308 of 8,814
==3152214==    at 0x483980B: malloc (vg_replace_malloc.c:309)
==3152214==    by 0x4DC9F7E: strdup (in /usr/lib64/libc-2.30.so)
==3152214==    by 0x48E373E: qstrdup (memory.c:122)
==3152214==    by 0x408FE7: pbr_map_nexthop_group_magic (pbr_vty.c:264)
==3152214==    by 0x408E04: pbr_map_nexthop_group (pbr_vty_clippy.c:347)
==3152214==    by 0x48ACF72: cmd_execute_command_real (command.c:1073)
==3152214==    by 0x48ACB3B: cmd_execute_command (command.c:1133)
==3152214==    by 0x48AD063: cmd_execute (command.c:1288)
==3152214==    by 0x493D8EE: vty_command (vty.c:526)
==3152214==    by 0x493D397: vty_execute (vty.c:1293)
==3152214==    by 0x493C4EC: vtysh_read (vty.c:2126)
==3152214==    by 0x49319DC: thread_call (thread.c:1548)

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: delete pbr nhg cache after rlease from hash
Stephen Worley [Mon, 6 Apr 2020 16:51:55 +0000 (12:51 -0400)]
pbrd: delete pbr nhg cache after rlease from hash

Actually delete the allocated pbr_nhg_cache object we just
released.

Found via memory leak:

==3078405== 136 bytes in 1 blocks are definitely lost in loss record 8,282 of 8,802
==3078405==    at 0x483BB1A: calloc (vg_replace_malloc.c:762)
==3078405==    by 0x48E35E8: qcalloc (memory.c:110)
==3078405==    by 0x40EBA7: pbr_nhgc_alloc (pbr_nht.c:194)
==3078405==    by 0x48CC0EB: hash_get (hash.c:148)
==3078405==    by 0x40F825: pbr_nht_add_individual_nexthop (pbr_nht.c:534)
==3078405==    by 0x409853: pbr_map_nexthop_magic (pbr_vty.c:400)
==3078405==    by 0x4093F1: pbr_map_nexthop (pbr_vty_clippy.c:417)
==3078405==    by 0x48ACF72: cmd_execute_command_real (command.c:1073)
==3078405==    by 0x48ACB3B: cmd_execute_command (command.c:1133)
==3078405==    by 0x48AD063: cmd_execute (command.c:1288)
==3078405==    by 0x493D8EE: vty_command (vty.c:526)
==3078405==    by 0x493D397: vty_execute (vty.c:1293)

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: add seqno to debug in pbr_send_pbr_map
Stephen Worley [Thu, 2 Apr 2020 17:31:24 +0000 (13:31 -0400)]
pbrd: add seqno to debug in pbr_send_pbr_map

Add some more debug info for the sequence number we are
sending to zebra in pbr_send_pbr_map().

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: define some explicit rule replace code paths
Stephen Worley [Thu, 19 Dec 2019 22:11:26 +0000 (17:11 -0500)]
zebra: define some explicit rule replace code paths

Define some explicit rule replace code paths into the dataplane
code and improve the handling around it/releasing the the old
rule from the hash table.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #6124 from kuldeepkash/bgp_basic_functionality
Donatas Abraitis [Thu, 9 Apr 2020 12:59:49 +0000 (15:59 +0300)]
Merge pull request #6124 from kuldeepkash/bgp_basic_functionality

tests: Adding new test suite bgp_as_allow_in

4 years agotests: Added new tests to bgp-basic-functionality-topo1
Kuldeep Kashyap [Wed, 1 Apr 2020 05:30:38 +0000 (05:30 +0000)]
tests: Added new tests to bgp-basic-functionality-topo1

1. Added 2 new test cases to bgp-basic-functionality-topo1
2. Enhanced 2 tests to run for both static routes and network advvertise command

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>