]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #7210 from idryzhov/route-types-disable-daemon
Donald Sharp [Thu, 19 Nov 2020 00:38:14 +0000 (19:38 -0500)]
Merge pull request #7210 from idryzhov/route-types-disable-daemon

lib: respect --disable-daemon flags in route_types.h

3 years agoMerge pull request #7454 from ranjanyash54/dev_8
Donald Sharp [Wed, 18 Nov 2020 23:37:30 +0000 (18:37 -0500)]
Merge pull request #7454 from ranjanyash54/dev_8

ospf6d: Json support added for command "show ipv6 ospf6 interface traffic [json]"

3 years agoMerge pull request #7455 from ranjanyash54/dev_3
Donald Sharp [Wed, 18 Nov 2020 23:33:09 +0000 (18:33 -0500)]
Merge pull request #7455 from ranjanyash54/dev_3

ospf6d: Json support added for command "show ipv6 ospf6 redistribute [json]"

3 years agoMerge pull request #7467 from ton31337/fix/bgpd_null_dereference
Donald Sharp [Wed, 18 Nov 2020 23:13:04 +0000 (18:13 -0500)]
Merge pull request #7467 from ton31337/fix/bgpd_null_dereference

bgpd: Check if peer is not NULL before calling peer_as_change()

3 years agoMerge pull request #7558 from opensourcerouting/bfd-v6-same
Donald Sharp [Wed, 18 Nov 2020 22:53:42 +0000 (17:53 -0500)]
Merge pull request #7558 from opensourcerouting/bfd-v6-same

bfdd: fix multiple links same address

3 years agoMerge pull request #7296 from YashRanjanVMWare/dev_1
Donald Sharp [Wed, 18 Nov 2020 22:50:42 +0000 (17:50 -0500)]
Merge pull request #7296 from YashRanjanVMWare/dev_1

ospf6d: Json support added for command "show ipv6 ospf6 [json]"

3 years agoMerge pull request #7556 from donaldsharp/memory_shenanigans
Mark Stapp [Wed, 18 Nov 2020 22:31:03 +0000 (17:31 -0500)]
Merge pull request #7556 from donaldsharp/memory_shenanigans

Memory shenanigans

3 years agoMerge pull request #7552 from volta-networks/fix_reload_l2pvn
Donald Sharp [Wed, 18 Nov 2020 20:27:51 +0000 (15:27 -0500)]
Merge pull request #7552 from volta-networks/fix_reload_l2pvn

tools: fix frr-reload l2vpn delete

3 years agoMerge pull request #7555 from idryzhov/cppcheck-fixes
Mark Stapp [Wed, 18 Nov 2020 19:29:25 +0000 (14:29 -0500)]
Merge pull request #7555 from idryzhov/cppcheck-fixes

fix a couple of issues found by cppcheck

3 years agobfdd: fix multiple links same address
Rafael Zalamena [Wed, 18 Nov 2020 18:47:00 +0000 (15:47 -0300)]
bfdd: fix multiple links same address

Allows users with multiple links using same IPv6 address (same VRF) to
work.

Reported-by: Matti Suuronen
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agobgpd: Prevent ecommunity_ecom2str memory leak
Donald Sharp [Wed, 18 Nov 2020 17:50:48 +0000 (12:50 -0500)]
bgpd: Prevent ecommunity_ecom2str memory leak

We were allocating but never freeing memory associated with the
ecommunity_ecom2str allocation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Do not leak vname if we find the match
Donald Sharp [Wed, 18 Nov 2020 17:10:22 +0000 (12:10 -0500)]
bgpd: Do not leak vname if we find the match

If we are attempting to store the bgp name for route
leaking and we find a match do not leak the memory.

Please note this is probably not really going to happen
ever.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7553 from donaldsharp/mem_leak_ferr
Mark Stapp [Wed, 18 Nov 2020 16:56:34 +0000 (11:56 -0500)]
Merge pull request #7553 from donaldsharp/mem_leak_ferr

lib: Cleanup mem-leaks in error case

3 years agoospf6d: Free up list memory
Donald Sharp [Wed, 18 Nov 2020 16:42:50 +0000 (11:42 -0500)]
ospf6d: Free up list memory

OSPFv3 snmp code creates a list but never deletes the actual
list.  Do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopimd: A buffer may be used uninited
Donald Sharp [Wed, 18 Nov 2020 16:42:06 +0000 (11:42 -0500)]
pimd: A buffer may be used uninited

If we screw up and don't have the right flags we'll print
out garbage.  At the very least just print out nothing.

Signed-off-by: Donald Sharp <sharp@nvidia.com>
3 years agolib: fix macro style
Igor Ryzhov [Wed, 18 Nov 2020 16:13:47 +0000 (19:13 +0300)]
lib: fix macro style

We prefer semicolon in the actual code instead of macro elsewhere in the
code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: fix uninitialized variable
Igor Ryzhov [Wed, 18 Nov 2020 16:07:49 +0000 (19:07 +0300)]
isisd: fix uninitialized variable

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospf6d: fix compilation of debug code
Igor Ryzhov [Wed, 18 Nov 2020 16:06:10 +0000 (19:06 +0300)]
ospf6d: fix compilation of debug code

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agozebra: fix writing to pointer instead of value
Igor Ryzhov [Wed, 18 Nov 2020 16:05:30 +0000 (19:05 +0300)]
zebra: fix writing to pointer instead of value

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: Cleanup mem-leaks in error case
Donald Sharp [Wed, 18 Nov 2020 13:54:51 +0000 (08:54 -0500)]
lib: Cleanup mem-leaks in error case

When we fail to properly lookup an error code, properly cleanup
on return.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7478 from donaldsharp/buffer
Mark Stapp [Wed, 18 Nov 2020 13:30:47 +0000 (08:30 -0500)]
Merge pull request #7478 from donaldsharp/buffer

Buffer

3 years agotools: fix frr-reload l2vpn delete
Emanuele Di Pascale [Wed, 11 Nov 2020 16:29:15 +0000 (17:29 +0100)]
tools: fix frr-reload l2vpn delete

when deleting a whole l2vpn context in ldpd which also had pseudowires
in it, we were first deleting the l2vpn with a 'no l2vpn XXX' command,
and then adding it again by running 'l2vpn XXX\n no member pseudowire YYY'
which obviously was not needed. As a result the l2vpn would be reinstated.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agoMerge pull request #7549 from vincentbernat/fix/oot-build
Rafael Zalamena [Wed, 18 Nov 2020 10:27:47 +0000 (07:27 -0300)]
Merge pull request #7549 from vincentbernat/fix/oot-build

vtysh: fix out-of-tree build not finding vtysh/daemons.pl

3 years agoMerge pull request #7548 from vincentbernat/feature/json-passive
Donatas Abraitis [Wed, 18 Nov 2020 06:39:28 +0000 (08:39 +0200)]
Merge pull request #7548 from vincentbernat/feature/json-passive

bgpd: identify passive connections in JSON summary

3 years agoMerge pull request #7543 from GalaxyGorilla/fix_refcmp_newline
Donald Sharp [Tue, 17 Nov 2020 20:30:07 +0000 (15:30 -0500)]
Merge pull request #7543 from GalaxyGorilla/fix_refcmp_newline

tests: ignore Windows vs Unix style newlines

3 years agoMerge pull request #7534 from chiragshah6/yang_nb1
Renato Westphal [Tue, 17 Nov 2020 20:13:20 +0000 (17:13 -0300)]
Merge pull request #7534 from chiragshah6/yang_nb1

bgpd: convert to yang modeled nbr cmds

3 years agovtysh: fix out-of-tree build not finding vtysh/daemons.pl
Vincent Bernat [Tue, 17 Nov 2020 19:49:20 +0000 (20:49 +0100)]
vtysh: fix out-of-tree build not finding vtysh/daemons.pl

This is needed to build with:

    mkdir build && cd build && ../configure && make

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
3 years agobgpd: identify passive connections in JSON summary
Vincent Bernat [Tue, 17 Nov 2020 19:29:31 +0000 (20:29 +0100)]
bgpd: identify passive connections in JSON summary

When using non JSON output, passive connections are marked with:

    BGP state = Active (passive)

However, such an information is not available in JSON output. This
commit adds that. It also adds "Active (NSF passive)" flag, like the
regular output.

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
3 years agoMerge pull request #6851 from kuldeepkash/bgp_graceful_restart
Donald Sharp [Tue, 17 Nov 2020 16:57:29 +0000 (11:57 -0500)]
Merge pull request #6851 from kuldeepkash/bgp_graceful_restart

tests: Fix for bgp_gr_functionality_topo1/topo2 failures

3 years agoMerge pull request #7303 from mobash-rasool/pim-fixes
Quentin Young [Tue, 17 Nov 2020 16:41:33 +0000 (11:41 -0500)]
Merge pull request #7303 from mobash-rasool/pim-fixes

pimd: checksum must be validated before accepting igmpv2 leave packet

3 years agoMerge pull request #7511 from donaldsharp/vtysh_warn
Patrick Ruddy [Tue, 17 Nov 2020 16:35:48 +0000 (16:35 +0000)]
Merge pull request #7511 from donaldsharp/vtysh_warn

Vtysh excessive/too little doc string re-instatement

3 years agobgpd: convert to yang modeled nbr cmds
Chirag Shah [Tue, 17 Nov 2020 02:42:20 +0000 (18:42 -0800)]
bgpd: convert to yang modeled nbr cmds

Convert to (DEFUN_YANG) yang modeled neighbor configuration
commands to count them in batched execution as part of backoff timer
introduced as part of PR # 6727

These configuration commands already converted transactional cli
but missed to mark them as (DEFUN_YANG).

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agoMerge pull request #7541 from ton31337/fix/hardcoded_function_names
Donald Sharp [Tue, 17 Nov 2020 14:28:09 +0000 (09:28 -0500)]
Merge pull request #7541 from ton31337/fix/hardcoded_function_names

bgpd: Use __func__ instead of hardcoded strings for some functions

3 years agopimd: checksum must be validated before accepting igmp packets
Mobashshera Rasool [Wed, 14 Oct 2020 13:51:32 +0000 (13:51 +0000)]
pimd: checksum must be validated before accepting igmp packets

Issue: When an IGMPv2 leave packet is received, it did not validate
the checksum and hence the packet is accepted and group specific
query is sent out in response to this.

Due to this IGMP conformance test case 6.1 failed.

https://github.com/FRRouting/frr/issues/6868

Fix: Validate the checksum for all IGMP packets

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agotests: ignore Windows vs Unix style newlines
GalaxyGorilla [Tue, 17 Nov 2020 13:11:34 +0000 (13:11 +0000)]
tests: ignore Windows vs Unix style newlines

Within unit tests the output of vtysh commands is compared to hand
made reference files. For some reason the output of those vtysh
commands contains Windows Style newlines which results in error
outputs which make it hard to identify this problem.

Since there seems to be no benefit in checking those newlines
anyway this commit just normalizes them.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
3 years agoMerge pull request #7540 from ton31337/fix/typo
Donald Sharp [Tue, 17 Nov 2020 13:13:17 +0000 (08:13 -0500)]
Merge pull request #7540 from ton31337/fix/typo

*: Replace typo (supress => suppress)

3 years agoMerge pull request #7450 from ranjanyash54/dev_5
Russ White [Tue, 17 Nov 2020 12:55:10 +0000 (07:55 -0500)]
Merge pull request #7450 from ranjanyash54/dev_5

ospf6d: Json support added for command "show ipv6 ospf6 zebra [json]"

3 years agoMerge pull request #7453 from ranjanyash54/dev_7
Russ White [Tue, 17 Nov 2020 12:53:41 +0000 (07:53 -0500)]
Merge pull request #7453 from ranjanyash54/dev_7

ospf6d: Json support added for command "show ipv6 ospf6 interface [json]"

3 years agoMerge pull request #7476 from opensourcerouting/bfd-fixes
Russ White [Tue, 17 Nov 2020 12:34:29 +0000 (07:34 -0500)]
Merge pull request #7476 from opensourcerouting/bfd-fixes

bfdd,lib: integration fixes

3 years agoMerge pull request #7518 from donaldsharp/asic_offload_more
Russ White [Tue, 17 Nov 2020 12:27:41 +0000 (07:27 -0500)]
Merge pull request #7518 from donaldsharp/asic_offload_more

Asic offload more

3 years agolib: Change zlog_debug to zlog_err for doc string issues
Donald Sharp [Thu, 12 Nov 2020 21:14:29 +0000 (16:14 -0500)]
lib: Change zlog_debug to zlog_err for doc string issues

Modify the code to change from zlog_debug to zlog_err.
vtysh was not outputting the vtysh doc string issues
after a change a couple of months back.  By changing
to error level we start seeing them on vtysh start up
again.  This will allow us to catch these issues
in the CI runs again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Fix excessive doc string for `no summary-address ..` command
Donald Sharp [Thu, 12 Nov 2020 21:13:48 +0000 (16:13 -0500)]
ospfd: Fix excessive doc string for `no summary-address ..` command

The `no summary-address ..` command had excessive doc string.
Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7520 from volta-networks/fix_ospf_mpls_te
Russ White [Tue, 17 Nov 2020 12:18:48 +0000 (07:18 -0500)]
Merge pull request #7520 from volta-networks/fix_ospf_mpls_te

ospfd: reset mpls-te prior to ospf router removal

3 years agoMerge pull request #7523 from donaldsharp/route_map_object_t
Russ White [Tue, 17 Nov 2020 12:16:12 +0000 (07:16 -0500)]
Merge pull request #7523 from donaldsharp/route_map_object_t

*: Remove route_map_object_t from the system

3 years agoMerge pull request #7536 from ton31337/fix/documentation
Russ White [Tue, 17 Nov 2020 12:12:33 +0000 (07:12 -0500)]
Merge pull request #7536 from ton31337/fix/documentation

doc: Replace _ to `` when bolding keyword for recently added BGP commands

3 years agoMerge pull request #7530 from ton31337/fix/safeguard_path->attr
Mark Stapp [Tue, 17 Nov 2020 12:09:54 +0000 (07:09 -0500)]
Merge pull request #7530 from ton31337/fix/safeguard_path->attr

bgpd: Make sure path->attr is not NULL before dereferencing

3 years agobgpd: Use __func__ instead of hardcoded strings for some functions
Donatas Abraitis [Tue, 17 Nov 2020 11:32:15 +0000 (13:32 +0200)]
bgpd: Use __func__ instead of hardcoded strings for some functions

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years ago*: Replace typo (supress => suppress)
Donatas Abraitis [Tue, 17 Nov 2020 10:06:23 +0000 (12:06 +0200)]
*: Replace typo (supress => suppress)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agodoc: Replace _ to `` when bolding keyword for recently added BGP commands
Donatas Abraitis [Tue, 17 Nov 2020 06:49:01 +0000 (08:49 +0200)]
doc: Replace _ to `` when bolding keyword for recently added BGP commands

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7521 from donaldsharp/set_src_future_us
Donatas Abraitis [Tue, 17 Nov 2020 06:33:59 +0000 (08:33 +0200)]
Merge pull request #7521 from donaldsharp/set_src_future_us

zebra: Allow `set src X` to work on startup

3 years agobgpd: Make sure path->attr is not NULL before dereferencing
Donatas Abraitis [Mon, 16 Nov 2020 16:05:53 +0000 (18:05 +0200)]
bgpd: Make sure path->attr is not NULL before dereferencing

Null-checking "path->attr" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoospf6d: Json support added for command "show ipv6 ospf6 interface [json]"
github login name [Fri, 9 Oct 2020 06:27:37 +0000 (23:27 -0700)]
ospf6d: Json support added for command "show ipv6 ospf6 interface [json]"

Modify code to add JSON format output in show command
"show ipv6 ospf6 interface" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoospf6d: Json support added for command "show ipv6 ospf6 zebra [json]"
github login name [Wed, 30 Sep 2020 12:05:36 +0000 (05:05 -0700)]
ospf6d: Json support added for command "show ipv6 ospf6 zebra [json]"

Modify code to add JSON format output in show command
"show ipv6 ospf6 zebra" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoospf6d: Json support added for command "show ipv6 ospf6 [json]"
github login name [Tue, 13 Oct 2020 12:44:52 +0000 (05:44 -0700)]
ospf6d: Json support added for command "show ipv6 ospf6 [json]"

Modify code to add JSON format output in show command
"show ipv6 ospf6" with proper formating.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoMerge pull request #7533 from donaldsharp/zlog_missing_on_failure
Mark Stapp [Tue, 17 Nov 2020 00:09:38 +0000 (19:09 -0500)]
Merge pull request #7533 from donaldsharp/zlog_missing_on_failure

lib: When aborting log data

3 years agoMerge pull request #7531 from qlyoung/fix-doc-block-quote
Mark Stapp [Mon, 16 Nov 2020 20:28:14 +0000 (15:28 -0500)]
Merge pull request #7531 from qlyoung/fix-doc-block-quote

doc: fix missing space before list

3 years agolib: When aborting log data
Donald Sharp [Mon, 16 Nov 2020 20:12:43 +0000 (15:12 -0500)]
lib: When aborting log data

When a FRR process dies due to SIGILL/SIGABORT/etc attempt
to drain the log buffer.  This code change is capturing
some missing logs that were not part of the log file on
a crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: fix missing space before list
Quentin Young [Mon, 16 Nov 2020 17:39:41 +0000 (12:39 -0500)]
doc: fix missing space before list

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #7526 from donaldsharp/i_am_a_robot_wumpalump
Donatas Abraitis [Mon, 16 Nov 2020 15:32:30 +0000 (17:32 +0200)]
Merge pull request #7526 from donaldsharp/i_am_a_robot_wumpalump

Cleanup on Aisle 5: Memory leaks, Uninited data and code snarfles

3 years agoospfd: reset mpls-te prior to ospf router removal
Carlo Galiotto [Fri, 13 Nov 2020 16:35:06 +0000 (17:35 +0100)]
ospfd: reset mpls-te prior to ospf router removal

This commits attempts to fix a problem that occurs when mpls-te gets
removed from ospfd config. Mpls-te has an inter-as option, which can be
set to Off/Area/AS. Whenever the inter-as takes "Area" or "AS" as a
value, this value will not be cleaned after removing mpls-te or after
removing the ospf router. Therefore, if mpls-te is configured with
inter-as AS or Area and we remove mpls-te or the ospf router, the
inter-as will still preserve its value; therefore, next time mpls-te is
enabled, it will automatically inherits the previous inter-as value
(either Area or AS). This leads to wrong configuration, which can be a
problem for frr_reload.py.
The commits forces mpls-te to reset inter-as to Off before it mpls-te
gets removed from the configuration and before the ospf router gets
removed.

Signed-off-by: Carlo Galiotto <carlo@voltanet.io>
3 years agoMerge pull request #7461 from donaldsharp/attribute_setget
Donatas Abraitis [Mon, 16 Nov 2020 10:20:40 +0000 (12:20 +0200)]
Merge pull request #7461 from donaldsharp/attribute_setget

Attribute setget

3 years agoMerge pull request #7510 from donaldsharp/xpath_stay
Donatas Abraitis [Mon, 16 Nov 2020 08:06:08 +0000 (10:06 +0200)]
Merge pull request #7510 from donaldsharp/xpath_stay

lib: Fix crash walking up command chain in bgp commands

3 years agoMerge pull request #7514 from donaldsharp/respect_e
Donatas Abraitis [Mon, 16 Nov 2020 06:57:50 +0000 (08:57 +0200)]
Merge pull request #7514 from donaldsharp/respect_e

bgpd: Respect `-e X` value for multipath

3 years agoMerge pull request #7525 from donaldsharp/dest_lock
Donatas Abraitis [Mon, 16 Nov 2020 06:51:55 +0000 (08:51 +0200)]
Merge pull request #7525 from donaldsharp/dest_lock

bgpd: Fix missed unlocks

3 years agoospf6d: Json support added for command "show ipv6 ospf6 interface traffic [json]"
github login name [Fri, 9 Oct 2020 07:53:39 +0000 (00:53 -0700)]
ospf6d: Json support added for command "show ipv6 ospf6 interface traffic [json]"

Modify code to add JSON format output in show command
"show ipv6 ospf6 interface traffic" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoospf6d: Json support added for command "show ipv6 ospf6 redistribute [json]"
github login name [Mon, 28 Sep 2020 05:25:10 +0000 (22:25 -0700)]
ospf6d: Json support added for command "show ipv6 ospf6 redistribute [json]"

Modify code to add JSON format output in show command
"show ipv6 ospf6 redistribute" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years ago*: Convert all usage of zclient_send_message to new enum
Donald Sharp [Wed, 11 Nov 2020 19:14:37 +0000 (14:14 -0500)]
*: Convert all usage of zclient_send_message to new enum

The `enum zclient_send_status` enum needs to be extended
throughout the code base to use the new states and
to fix up places where we tested against the return
value being non zero.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd, lib, sharpd: Add enum for zclient_send_message return
Donald Sharp [Fri, 6 Nov 2020 23:21:50 +0000 (18:21 -0500)]
bgpd, lib, sharpd: Add enum for zclient_send_message return

Add a `enum zclient_send_status` for appropriate handling
of return codes from zclient_send_message.  Touch all the places
where we handle this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agosharpd: Add buffering support
Donald Sharp [Fri, 6 Nov 2020 20:47:07 +0000 (15:47 -0500)]
sharpd: Add buffering support

Have sharpd notice that when sending routes to zebra that the
underlying system has buffered data and to pause sending
more data to zebra until such time we get a callback that
the write was successful to zebra.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agosharpd: Re-arrange route_add|delete
Donald Sharp [Fri, 6 Nov 2020 13:19:53 +0000 (08:19 -0500)]
sharpd: Re-arrange route_add|delete

These functions are never called outside of sharp_zebra.c, re-arrange
a little to make the inclusions in sharp_zebra.h not needed and
to also have these functions return whether or not the underlying
buffering system was invoked in stream sending.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd, lib: Indicate when we are buffering instead of immediately sending down ZAPI
Donald Sharp [Mon, 12 Oct 2020 13:51:09 +0000 (09:51 -0400)]
bgpd, lib: Indicate when we are buffering instead of immediately sending down ZAPI

When FRR sends data over the ZAPI protocol from the upper levels to zebra, indicate
to the calling functions that we have started buffering data to be sent if the
socket is full underneath it.

Also add a call back function `zebra_buffer_write_ready` that we can call
when an upper level protocol's socket buffer has been drained.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: clean up out-of-date zapi comment
Mark Stapp [Wed, 26 Aug 2020 20:52:13 +0000 (16:52 -0400)]
lib: clean up out-of-date zapi comment

Clean up and edit a comment about zapi route encoding; was
outdated (or just ... wrong).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: use smaller stream buffer for zapi route notifications
Mark Stapp [Thu, 20 Aug 2020 18:13:34 +0000 (14:13 -0400)]
zebra: use smaller stream buffer for zapi route notifications

The owner-notification zapi message is small; use a small buffer
for it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7513 from mjstapp/fix_bgp_sa_label
Donald Sharp [Sun, 15 Nov 2020 19:34:09 +0000 (14:34 -0500)]
Merge pull request #7513 from mjstapp/fix_bgp_sa_label

bgpd: fix SA warning

3 years agozebra: Add offload and trap counts to summary command for json output
Donald Sharp [Fri, 13 Nov 2020 14:51:30 +0000 (09:51 -0500)]
zebra: Add offload and trap counts to summary command for json output

For the json output add offload and trap route counts for the
json output.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Add `--asic-offload` command
Donald Sharp [Mon, 28 Sep 2020 19:22:52 +0000 (15:22 -0400)]
zebra: Add `--asic-offload` command

Add a command that allows FRR to know it's being used with
an underlying asic offload, from the linux kernel perspective.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib, zebra: Add ability to read kernel notice of Offload Failed
Donald Sharp [Mon, 26 Oct 2020 12:46:57 +0000 (08:46 -0400)]
lib, zebra: Add ability to read kernel notice of Offload Failed

The linux kernel is getting RTM_F_OFFLOAD_FAILED for kernel routes
that have failed to offload.  Write the code
to receive these notifications from the linux kernel
and store that data for display about the routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoinclude: Update rtnetlink.h
Donald Sharp [Mon, 26 Oct 2020 12:28:02 +0000 (08:28 -0400)]
include: Update rtnetlink.h

Update to latest kernel version of rtnetlink.h  We are
really bringing in the RTM_F_OFFLOAD_FAILED change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert attr->vnc_subtlvs to use accessor functions
Donald Sharp [Mon, 2 Nov 2020 18:44:47 +0000 (13:44 -0500)]
bgpd: Convert attr->vnc_subtlvs to use accessor functions

Add a get/set accessor functions and use them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert attr->evpn_overlay to accessor functions
Donald Sharp [Mon, 2 Nov 2020 17:55:45 +0000 (12:55 -0500)]
bgpd: Convert attr->evpn_overlay to accessor functions

Convert usage of the attr->evpn_overlay to get/set functionality.
Future commits will allow us to abstract this data to when
we actually need it for the `struct attr`.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Abstract attr->cluster to accessor/set functions
Donald Sharp [Mon, 2 Nov 2020 17:35:20 +0000 (12:35 -0500)]
bgpd: Abstract attr->cluster to accessor/set functions

Abstract the access of `attr->cluster` to appropriate
accessor/set functionality.

Future commits will allow us to move this data around
to make `struct attr` smaller.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert attr->transit to use accessor functions
Donald Sharp [Mon, 2 Nov 2020 17:09:25 +0000 (12:09 -0500)]
bgpd: Convert attr->transit to use accessor functions

Convert the `struct attr`->transit variable to use
accessor functions.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert ipv6_ecommunity to use accessor functions
Donald Sharp [Mon, 2 Nov 2020 16:12:39 +0000 (11:12 -0500)]
bgpd: Convert ipv6_ecommunity to use accessor functions

Convert the `struct attr`->ipv6_ecommunity to use
accessor functions. We'll be able to reduce memory
usage in the `struct bgp_attr` by doing this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add accessor for bgp_attr.pmsi_tnl_type
Donald Sharp [Mon, 2 Nov 2020 15:52:40 +0000 (10:52 -0500)]
bgpd: Add accessor for bgp_attr.pmsi_tnl_type

Add an accessor for the bgp_attr.pmsi_tnl_type to allow
us to abstract where it is.  Every attribute is paying
the price of this bit of data as part of `struct bgp_attr`
In the future we'll move it elsewhere.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Allow NULL to be passed in for ecommunity_free
Donald Sharp [Mon, 2 Nov 2020 16:20:32 +0000 (11:20 -0500)]
bgpd: Allow NULL to be passed in for ecommunity_free

Allow some cleanup of if statements to just make
ecommunity_free() check this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobabeld: Free ifc leak
Donald Sharp [Sun, 15 Nov 2020 02:19:42 +0000 (21:19 -0500)]
babeld: Free ifc leak

On removal of an address on an interface babel was not properly
cleaning memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Free aggr_suppresors list on extra deletion
Donald Sharp [Sun, 15 Nov 2020 00:16:57 +0000 (19:16 -0500)]
bgpd: Free aggr_suppresors list on extra deletion

When we delete the bgp_path_info_extra data structure free
the aggr_suppressors data structure that was left dangling.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI
Donald Sharp [Sat, 14 Nov 2020 23:50:37 +0000 (18:50 -0500)]
bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI

Move the FOREACH_AFI_SAFI macro from bgpd.h to zebra.h( GLOBAL's YOUALL )

Then convert all the places that have the two level for loop to
iterate over all afi/safis

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: If using filters free up name on peer deletion
Donald Sharp [Sat, 14 Nov 2020 23:35:21 +0000 (18:35 -0500)]
bgpd: If using filters free up name on peer deletion

FRR was not properly deleting the aname and cnmae
memory that was allocated if bgp is using filters.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: Free created tables
Donald Sharp [Sat, 14 Nov 2020 22:58:40 +0000 (17:58 -0500)]
isisd: Free created tables

On redistribution into isis we were creating a table for
handling the redistributed routes, but never cleaning them
up on shutdown properly.  Do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: print prefix instead of unininted buf
Donald Sharp [Sat, 14 Nov 2020 22:40:53 +0000 (17:40 -0500)]
bgpd: print prefix instead of unininted buf

The recent change to use %pFX missed a code path
where we were displaying a buf that was uninited.
Display the prefix as intended.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: on debug esi was not properly setup
Donald Sharp [Sat, 14 Nov 2020 22:33:43 +0000 (17:33 -0500)]
bgpd: on debug esi was not properly setup

There exists a code path where the esi would be passed
to a debug without the esi being setup with any values
causing us to display what ever is on the stack.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: On shutdown leaking spf_timer thread data
Donald Sharp [Sat, 14 Nov 2020 22:32:01 +0000 (17:32 -0500)]
isisd: On shutdown leaking spf_timer thread data

When isis is being shutdown the area->spf_timer thread has
special data assigned to that was never being freed.
Free this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobfdd: On interface address delete we are leaking memory
Donald Sharp [Sat, 14 Nov 2020 22:31:21 +0000 (17:31 -0500)]
bfdd: On interface address delete we are leaking memory

The interface address delete callback from zebra was not
deleting the ifc that was created as per normal work methodologies

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: When showing a lcommunity free alloced memory
Donald Sharp [Sat, 14 Nov 2020 21:29:16 +0000 (16:29 -0500)]
bgpd: When showing a lcommunity free alloced memory

We are temporarily allocing memory to show lcommunity
information.  We then immediately drop it.  Account for
that memory properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Fix missed unlocks
Donald Sharp [Sat, 14 Nov 2020 20:32:49 +0000 (15:32 -0500)]
bgpd: Fix missed unlocks

When iterating over the bgp_dest table, using this pattern:

for (dest = bgp_table_top(table); dest;
     dest = bgp_route_next(dest)) {

If the code breaks or returns in the middle we will not have
properly unlocked the node as that bgp_table_top locks the top
dest and bgp_route_next locks the next dest and unlocks the old
dest.

From code inspection I have found a bunch of places that
we either return in the middle of or a break is issued.

Add appropriate unlocks.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years ago*: Remove route_map_object_t from the system
Donald Sharp [Sat, 14 Nov 2020 00:35:20 +0000 (19:35 -0500)]
*: Remove route_map_object_t from the system

The route_map_object_t was being used to track what protocol we were
being called against.  But each protocol was only ever calling itself.
So we had a variable that was only ever being passed in from route_map_apply
that had to be carried against and everyone was testing if that variable
was for their own stack.

Clean up this route_map_object_t from the entire system.  We should
speed some stuff up.  Yes I know not a bunch but this will add up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Allow `set src X` to work on startup
Donald Sharp [Fri, 13 Nov 2020 17:06:57 +0000 (12:06 -0500)]
zebra: Allow `set src X` to work on startup

If a route-map in zebra has `set src X` and the interface
X is on has not been configured yet, we are rejecting the command
outright.  This is a problem on boot up especially( and where I
found this issue ) in that interfaces *can* and *will* be slow
on startup and config can easily be read in *before* the
interface has an ip address.

Let's modify zebra to just warn to the user we may have a problem
and let the chips fall where they may.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7512 from mjstapp/fix_doc_bgp_v6
Quentin Young [Fri, 13 Nov 2020 21:04:09 +0000 (16:04 -0500)]
Merge pull request #7512 from mjstapp/fix_doc_bgp_v6

doc: fix dup label in bgp doc

3 years agoMerge pull request #7474 from eololab/fix-crash-skiplist-debug
Mark Stapp [Fri, 13 Nov 2020 15:54:49 +0000 (10:54 -0500)]
Merge pull request #7474 from eololab/fix-crash-skiplist-debug

lib, bgpd: fix crash using skiplist debug function