]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
5 years agoMerge pull request #6135 from opensourcerouting/cli-node-cleanup
Donald Sharp [Thu, 16 Apr 2020 23:24:56 +0000 (19:24 -0400)]
Merge pull request #6135 from opensourcerouting/cli-node-cleanup

*: clean up the mess that is CLI command nodes

5 years agoMerge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_any
Quentin Young [Thu, 16 Apr 2020 19:40:03 +0000 (15:40 -0400)]
Merge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_any

bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"

5 years agoMerge pull request #5913 from taspelund/evpn_route_type_int
Donatas Abraitis [Thu, 16 Apr 2020 19:28:19 +0000 (22:28 +0300)]
Merge pull request #5913 from taspelund/evpn_route_type_int

bgpd: Allow 'show bgp l2vpn evpn route type' to use RT number in addition to existing keywords

5 years agoMerge pull request #6224 from mjstapp/zclient_session_id
Olivier Dugeon [Thu, 16 Apr 2020 19:12:30 +0000 (21:12 +0200)]
Merge pull request #6224 from mjstapp/zclient_session_id

lib,zebra: add a session id for zapi sessions

5 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>
5 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>
5 years agoMerge pull request #5451 from opensourcerouting/rcu-log
Santosh P K [Thu, 16 Apr 2020 14:53:44 +0000 (20:23 +0530)]
Merge pull request #5451 from opensourcerouting/rcu-log

logging subsystem rewrite

5 years agoMerge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanup
Donatas Abraitis [Thu, 16 Apr 2020 13:05:34 +0000 (16:05 +0300)]
Merge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanup

tests: Cleanup bgp config for evpn vxlan topotest

5 years agobgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"
Donatas Abraitis [Thu, 16 Apr 2020 08:15:35 +0000 (11:15 +0300)]
bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"

That's only 0/1, useful to use just a bool for that.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotests: Cleanup bgp config for evpn vxlan topotest
Donald Sharp [Thu, 16 Apr 2020 11:04:27 +0000 (07:04 -0400)]
tests: Cleanup bgp config for evpn vxlan topotest

The bgp configuration for the vxlan topotest mixed
and matched some configuration that does not belong
for an IBGP setup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: #define FRR_CMD_NODE_20200416
David Lamparter [Thu, 16 Apr 2020 10:55:02 +0000 (12:55 +0200)]
lib: #define FRR_CMD_NODE_20200416

... requested by Lou.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years agovtysh: use parent_node for vtysh_exit()
David Lamparter [Thu, 2 Apr 2020 10:06:12 +0000 (12:06 +0200)]
vtysh: use parent_node for vtysh_exit()

Cleaning up the whole mess of "exit" and "quit" commands that follows is
left for a rainy day :(

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: add ->node_exit to struct cmd_node
David Lamparter [Sat, 8 Sep 2018 22:03:19 +0000 (00:03 +0200)]
*: add ->node_exit to struct cmd_node

Rather than doing a f*gly hack for the RPKI code, let's do an on-exit
hook in cmd_node.  Also allows replacing some special-casing in the vty
code.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agozebra: fix FPM node reusing VTY_NODE
David Lamparter [Wed, 15 Apr 2020 10:26:01 +0000 (12:26 +0200)]
zebra: fix FPM node reusing VTY_NODE

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years ago*: move CLI node names to cmd_node->name
David Lamparter [Sat, 8 Sep 2018 22:15:50 +0000 (00:15 +0200)]
*: move CLI node names to cmd_node->name

And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: move CLI parent data to cmd_node->parent_node
David Lamparter [Sat, 8 Sep 2018 21:15:09 +0000 (23:15 +0200)]
*: move CLI parent data to cmd_node->parent_node

Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: remove second parameter on install_node()
David Lamparter [Sat, 8 Sep 2018 20:31:43 +0000 (22:31 +0200)]
*: remove second parameter on install_node()

There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: remove cmd_node->vtysh
David Lamparter [Sat, 8 Sep 2018 20:00:24 +0000 (22:00 +0200)]
*: remove cmd_node->vtysh

The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: clean up cmd_node initializers
David Lamparter [Sat, 8 Sep 2018 19:46:23 +0000 (21:46 +0200)]
*: clean up cmd_node initializers

... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #6237 from ton31337/fix/show_hostname_in_bgp
Donald Sharp [Thu, 16 Apr 2020 10:45:42 +0000 (06:45 -0400)]
Merge pull request #6237 from ton31337/fix/show_hostname_in_bgp

bgpd: Show hostname in `show [ip] bgp ...` only if nexthop is connected

5 years agotests: Check if the right next-hop is shown (bgp_show_ip_bgp_fqdn)
Donatas Abraitis [Thu, 16 Apr 2020 07:37:21 +0000 (10:37 +0300)]
tests: Check if the right next-hop is shown (bgp_show_ip_bgp_fqdn)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Show hostname in `show [ip] bgp ...` only if nexthop is connected
Donatas Abraitis [Thu, 16 Apr 2020 07:36:59 +0000 (10:36 +0300)]
bgpd: Show hostname in `show [ip] bgp ...` only if nexthop is connected

The problem is when using kinda such topologies:
(192.168.1.1/32) r1 <-- eBGP --> r2 <-- iBGP --> r3

Looking at r3's nexthop for 192.168.1.1/32 we have it as r2, but really
it MUST be r1.

Checking if the nexthop is connected solves the problem even for cases
when route-reflectors are used.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6232 from ton31337/fix/validate_lcommunities
Donald Sharp [Wed, 15 Apr 2020 18:19:16 +0000 (14:19 -0400)]
Merge pull request #6232 from ton31337/fix/validate_lcommunities

bgpd: Validate all large communities if specified more per line

5 years agoMerge pull request #6229 from donaldsharp/netlink_request_fixup
Rafael Zalamena [Wed, 15 Apr 2020 16:45:58 +0000 (13:45 -0300)]
Merge pull request #6229 from donaldsharp/netlink_request_fixup

zebra: Modify netlink_request to statisfy coverity

5 years agobgpd: Validate all large communities if specified more per line
Donatas Abraitis [Wed, 15 Apr 2020 15:21:24 +0000 (18:21 +0300)]
bgpd: Validate all large communities if specified more per line

```
(config)# bgp large-community-list standard FRR-1 permit 1:1:1:1
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2 3:3:2
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2 3:3:2 0:0:0
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 0:0:1231321231414
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2:3 3:3:2 0:0:
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2:3 3:3:2 0:2:3
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2:3 3:3:2
(config)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6230 from donaldsharp/nhrp_json_silliness
Donatas Abraitis [Wed, 15 Apr 2020 15:06:38 +0000 (18:06 +0300)]
Merge pull request #6230 from donaldsharp/nhrp_json_silliness

nhrpd: Actually allow json output

5 years agoMerge pull request #6226 from LabNConsulting/ziemba/ldpd-fix-md5key-length
Renato Westphal [Wed, 15 Apr 2020 14:46:30 +0000 (11:46 -0300)]
Merge pull request #6226 from LabNConsulting/ziemba/ldpd-fix-md5key-length

ldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation

5 years agonhrpd: Actually allow json output
Donald Sharp [Wed, 15 Apr 2020 13:25:54 +0000 (09:25 -0400)]
nhrpd: Actually allow json output

Add the correct pointer check to see if we should
be doing json output.

Discovered by SA.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Modify netlink_request to statisfy coverity
Donald Sharp [Wed, 15 Apr 2020 12:56:03 +0000 (08:56 -0400)]
zebra: Modify netlink_request to statisfy coverity

The netlink_request function takes a `struct nlmsghdr *`
pointer from a common pattern that we use:

struct {
struct nlmsghdr n;
struct fib_rule_hdr frh;
char buf[NL_PKT_BUF_SIZE];
} req;

We were calling it `netlink_request(Socket, &req.n)`

The problem here is that coverity, rightly so, sees that
we access the data after the nlmsghdr in netlink_request and
tells us we have an read beyond end of the structure.  While
we know we haven't mangled anything up here because of manual
inspection coverity doesn't have this knowledge implicitly.

So let's modify the code call to netlink_request to pass in the
void pointer of the req structure itself, cast to the appropriate
data structure in the function and do the right thing.  Hopefully
the coverity SA will be happy and we can move on with our life.

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

5 years agoldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation
G. Paul Ziemba [Wed, 15 Apr 2020 02:08:57 +0000 (19:08 -0700)]
ldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation

Per issue #6202

Very long passwords (>79 chars) get truncated: save truncated
length in nbrp->auth.md5key_len instead of original length.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
5 years agodoc: Add doc for `show bgp l2vpn evpn route type`
Trey Aspelund [Thu, 5 Mar 2020 00:24:51 +0000 (19:24 -0500)]
doc: Add doc for `show bgp l2vpn evpn route type`

Add documentation for this command and its RT filters.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
5 years agobgpd: Add int args to `show bgp evpn route type`
Trey Aspelund [Tue, 10 Mar 2020 18:11:12 +0000 (14:11 -0400)]
bgpd: Add int args to `show bgp evpn route type`

This adds numeric keywords to 'show bgp l2vpn evpn route type'.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
5 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

5 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

5 years agobgpd: Fix typos in `show bgp evpn route type`
Trey Aspelund [Tue, 10 Mar 2020 18:08:54 +0000 (14:08 -0400)]
bgpd: Fix typos in `show bgp evpn route type`

This fixes unnecessary whitespaces and makes capitalization
match for route type help strings.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
5 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

5 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

5 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>
5 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

5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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

5 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

5 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>

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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

5 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>
5 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>
5 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>
5 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

5 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

5 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>
5 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>
5 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

5 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>
5 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>
5 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>
5 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…

5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>