]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #8588 from idryzhov/a-lot-of-isis-fixes
Rafael Zalamena [Fri, 30 Apr 2021 10:58:19 +0000 (07:58 -0300)]
Merge pull request #8588 from idryzhov/a-lot-of-isis-fixes

a lot of isis fixes

3 years agoMerge pull request #8585 from stipmonster/asan-fixes-ospf-te
Olivier Dugeon [Fri, 30 Apr 2021 09:34:32 +0000 (11:34 +0200)]
Merge pull request #8585 from stipmonster/asan-fixes-ospf-te

ospfd: Fixed some ASAN errors

3 years agoMerge pull request #8569 from Jafaral/doc-svi
Donatas Abraitis [Fri, 30 Apr 2021 08:20:41 +0000 (11:20 +0300)]
Merge pull request #8569 from Jafaral/doc-svi

doc: add evpn discussion of svi and arp cache

3 years agoMerge pull request #8570 from qlyoung/revert-ringbuf-readv
Rafael Zalamena [Thu, 29 Apr 2021 21:32:52 +0000 (18:32 -0300)]
Merge pull request #8570 from qlyoung/revert-ringbuf-readv

Revert "bgpd: improve socket read performance"

3 years agoMerge pull request #7789 from rgirada/fix_DR
Olivier Dugeon [Thu, 29 Apr 2021 18:01:06 +0000 (20:01 +0200)]
Merge pull request #7789 from rgirada/fix_DR

ospfd: show ip ospf interface displays only BDR info, Added DR info.

3 years agodoc: add evpn discussion of svi and arp cache
Jafar Al-Gharaibeh [Mon, 26 Apr 2021 20:02:29 +0000 (15:02 -0500)]
doc: add evpn discussion of svi and arp cache

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agoMerge pull request #7165 from qlyoung/fix-zapi-codec-badness
Rafael Zalamena [Thu, 29 Apr 2021 16:50:16 +0000 (13:50 -0300)]
Merge pull request #7165 from qlyoung/fix-zapi-codec-badness

Fix zapi codec badness

3 years agoMerge pull request #8409 from rgirada/ospf-memleak
Donald Sharp [Thu, 29 Apr 2021 16:50:03 +0000 (12:50 -0400)]
Merge pull request #8409 from rgirada/ospf-memleak

ospfd: Fixing few valgrind issues

3 years agoMerge pull request #8591 from mjstapp/fix_sharp_redist_lsp
Igor Ryzhov [Thu, 29 Apr 2021 16:48:03 +0000 (19:48 +0300)]
Merge pull request #8591 from mjstapp/fix_sharp_redist_lsp

sharpd: use correct list of redist protocols in remove lsp

3 years agoMerge pull request #8592 from donaldsharp/debug_cleanup
Mark Stapp [Thu, 29 Apr 2021 16:42:56 +0000 (12:42 -0400)]
Merge pull request #8592 from donaldsharp/debug_cleanup

zebra: msgdump debug strangeness cleanup

3 years agobgpd: avoid allocating very large stack buffer
Quentin Young [Mon, 26 Apr 2021 22:59:48 +0000 (18:59 -0400)]
bgpd: avoid allocating very large stack buffer

As pointed out on code review of BGP extended messages, increasing the
maximum BGP message size has the consequence of growing the dynamically
sized stack buffer up to 650K. While unlikely to exceed modern stack
sizes it is still unreasonably large. Remedy this with a heap buffer.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoRevert "lib: add ringbuf socket read function"
Quentin Young [Mon, 26 Apr 2021 22:42:19 +0000 (18:42 -0400)]
Revert "lib: add ringbuf socket read function"

This reverts commit d9d7af1a52d77ed0074ebb72f87678308296e74e.

3 years agoRevert "bgpd: improve socket read performance"
Quentin Young [Mon, 26 Apr 2021 22:42:12 +0000 (18:42 -0400)]
Revert "bgpd: improve socket read performance"

This reverts commit 97a16e648115919aab3784a6511807e35c20ee20.

3 years agoMerge pull request #8110 from rgirada/rmap_nb
Igor Ryzhov [Thu, 29 Apr 2021 14:29:55 +0000 (17:29 +0300)]
Merge pull request #8110 from rgirada/rmap_nb

lib: Routemap is not getting applied upon changing the routemap action

3 years agolib: Routemap is not getting applied upon changing the routemap action
rgirada [Fri, 19 Feb 2021 04:15:40 +0000 (20:15 -0800)]
lib: Routemap is not getting applied upon changing the routemap action

Description:
This looks broken after NB changes in routemap. When routemap
action modified from permit to deny, it is expected to apply
the new action on the filtered routes before the action in the
routemap data structure has been changed. But currently this is
not handled by the corresponding northbound API.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoMerge pull request #8559 from idryzhov/fix-printfrr-test-build
Mark Stapp [Thu, 29 Apr 2021 14:12:44 +0000 (10:12 -0400)]
Merge pull request #8559 from idryzhov/fix-printfrr-test-build

tests: fix build warning

3 years agoisisd: move ldp-sync checks from cli to nb callbacks
Igor Ryzhov [Mon, 26 Apr 2021 19:01:43 +0000 (22:01 +0300)]
isisd: move ldp-sync checks from cli to nb callbacks

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: don't use operational data in "no isis circuit-type"
Igor Ryzhov [Mon, 26 Apr 2021 18:34:39 +0000 (21:34 +0300)]
isisd: don't use operational data in "no isis circuit-type"

Use the config data instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd, yang: remove vrf leaf from isis interface node
Igor Ryzhov [Mon, 26 Apr 2021 18:13:08 +0000 (21:13 +0300)]
isisd, yang: remove vrf leaf from isis interface node

This is very confusing and incorrect. We can and should use vrf leaf of
the interface itself instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: don't use operational data in "ip/ipv6 router isis"
Igor Ryzhov [Mon, 26 Apr 2021 15:30:53 +0000 (18:30 +0300)]
isisd: don't use operational data in "ip/ipv6 router isis"

Currently the operational data is used for two things:
- to inherit the is-type from the isis instance
- to set passive flag for loopback interfaces

This commit implements the first one using only the config data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: don't create instances directly from cli
Igor Ryzhov [Mon, 26 Apr 2021 15:09:19 +0000 (18:09 +0300)]
isisd: don't create instances directly from cli

This must be done only through NB code. The necessary change is enqueued
right on the next two lines.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: don't use operational data in "no router isis"
Igor Ryzhov [Mon, 26 Apr 2021 14:47:19 +0000 (17:47 +0300)]
isisd: don't use operational data in "no router isis"

We need to delete isis config from interfaces when we delete the isis
router instance. This should be done using only config data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: remove useless checks from cli
Igor Ryzhov [Mon, 26 Apr 2021 13:48:11 +0000 (16:48 +0300)]
isisd: remove useless checks from cli

is-type defaults to level-1-2 for more than a year already.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: fix ldp-sync configuration
Igor Ryzhov [Wed, 28 Apr 2021 22:59:56 +0000 (01:59 +0300)]
isisd: fix ldp-sync configuration

YANG model and CLI commands allow user to configure LDP-sync per area.
But the actual implementation is incorrect - all commands are changing
the config for the whole VRF instead of a single area. This commit fixes
this issue by actually implementing per area configuration.

Fixes #8578.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: allow arbitrary order of area/interface configuration
Igor Ryzhov [Tue, 27 Apr 2021 22:57:21 +0000 (01:57 +0300)]
isisd: allow arbitrary order of area/interface configuration

Currently we don't allow to configure the interface before the area is
configured. This approach has the following issues:

1. The area config can be deleted even when we have an interface config
   relying on it. The code is not ready for that - we'll have a whole
   bunch of stale pointers if user does that.
2. The code doesn't correctly process the event of changing the VRF for
   an interface. There is no mechanism to ensure that the area exists
   in the new VRF so currently the circuit still stays in the old VRF.

This commit allows an arbitrary order of area/interface configuration.
There is no more need to configure the area before configuring the
interface.

This change fixes both the issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: update link params after circuit is up
Igor Ryzhov [Tue, 27 Apr 2021 12:06:37 +0000 (15:06 +0300)]
isisd: update link params after circuit is up

Call from isis_circuit_create works only if we enable isis on an already
existing interface. If we configure isis on a pseudo interface and then
actually create it - this call doesn't work.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: fix incorrect snmp-id gen/free
Igor Ryzhov [Tue, 27 Apr 2021 14:28:44 +0000 (17:28 +0300)]
isisd: fix incorrect snmp-id gen/free

Necessary structures for snmp-id generation are currently stored in
`struct isis`. When we generate the new circuit ID, we always use the
instance from the default VRF. When we free the circuit ID, we use the
instance from the circuit VRF. This causes the following problems:

1. If there is no instance in the default VRF, this code doesn't work.
2. When circuit in non-default VRF is deleted, the ID is not actually
   freed.

This is fixed by using global structures instead. The code itself is
moved to isis_snmp.c and linked to the main code using hooks. We should
not call SNMP-related code when the SNMP module is not loaded at all.

More than that, we don't allow to activate the circuit if we failed to
generate the SNMP ID. Even if SNMP support is completely disabled! This
check is removed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agozebra: msgdump debug strangeness cleanup
Donald Sharp [Thu, 29 Apr 2021 12:16:22 +0000 (08:16 -0400)]
zebra: msgdump debug strangeness cleanup

a) `debug zebra kernel` turns off `debug zebra kernel msgdump....`
this is odd and bad

b) `debug zebra kernel msgdump send` turns off receive and vice versa
this is counter intuitive as well

c) `no zebra kernel msgdump ...` turns off all kernel level debugging
we should only turn off msgdump specific debugs

d) `no debug zebra kernel` turns off all kernel level debugging
we should leave msgdump on.

e) Fix `show run` and show debug output

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agosharpd: use correct list of redist protocols in remove lsp
Mark Stapp [Thu, 29 Apr 2021 12:15:08 +0000 (08:15 -0400)]
sharpd: use correct list of redist protocols in remove lsp

The remove lsp command was using the wrong list of route
protocols - use the ZEBRA list, same as the other clis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoospfd: show ip ospf interface only shows BDR info, Added DR info.
rgirada [Wed, 23 Dec 2020 09:13:17 +0000 (01:13 -0800)]
ospfd: show ip ospf interface only shows BDR info, Added DR info.

Description:
DR information is missing under "show ip ospf interface [json]".
Added DR infomation to display in "show ip ospf interface".

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agotests: fix build warning
Igor Ryzhov [Mon, 26 Apr 2021 08:23:47 +0000 (11:23 +0300)]
tests: fix build warning

FMT_NSTD_BEGIN should be before the first use of "expr".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8586 from volta-networks/fix_openbsd_doc
Quentin Young [Wed, 28 Apr 2021 23:33:58 +0000 (23:33 +0000)]
Merge pull request #8586 from volta-networks/fix_openbsd_doc

3 years agoMerge pull request #8546 from ton31337/fix/add_markers_for_recent_bgpd
Quentin Young [Wed, 28 Apr 2021 19:51:28 +0000 (19:51 +0000)]
Merge pull request #8546 from ton31337/fix/add_markers_for_recent_bgpd

3 years agodoc: clang in openbsd is the default and update compiler.
Javier Garcia [Wed, 28 Apr 2021 15:30:39 +0000 (17:30 +0200)]
doc: clang in openbsd is the default and update compiler.

Also
 - update info about new packages needed as libcares.
 - create proper links to libyang so ld can find the lib.

Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
3 years agozebra: use safe stream decodes for evpn zapi msg
Quentin Young [Wed, 23 Sep 2020 19:40:28 +0000 (15:40 -0400)]
zebra: use safe stream decodes for evpn zapi msg

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agopimd, zebra: explicit cast int netlink val to uint
Quentin Young [Wed, 23 Sep 2020 19:37:48 +0000 (15:37 -0400)]
pimd, zebra: explicit cast int netlink val to uint

encoding signed int as unsigned is bad practice; since we want to do
it here lets at least be explicit about it

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agolib, bgpd, zebra: RA interval is unsigned
Quentin Young [Wed, 23 Sep 2020 19:35:51 +0000 (15:35 -0400)]
lib, bgpd, zebra: RA interval is unsigned

Use unsigned value for all RA requests to Zebra

- encoding signed int as unsigned is bad practice
- RA interval is never, and should never be, negative

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agobgpd, zebra: encode ip addr len as uint16
Quentin Young [Wed, 23 Sep 2020 19:31:52 +0000 (15:31 -0400)]
bgpd, zebra: encode ip addr len as uint16

This is always a 16 bit unsigned value.

- signed int is the wrong type to use
- encoding a signed int as a uint32 is bad practice
- decoding a signed int encoded as a uint32 into a uint16 is bad
  practice

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8322 from qlyoung/topotests
Jafar Al-Gharaibeh [Wed, 28 Apr 2021 15:40:25 +0000 (10:40 -0500)]
Merge pull request #8322 from qlyoung/topotests

Assorted topotests cleanup

3 years agoospfd: Fixed some ASAN errors
Erik Kooistra [Wed, 28 Apr 2021 13:28:28 +0000 (15:28 +0200)]
ospfd: Fixed some ASAN errors

This fixes 2 asan errors:
If we only have a TLV_ROUTER_ADDR don't continue after we skipped it.
Fixed length when parsing EXT_TLV_LINK_SIZE.

Signed-off-by: Erik Kooistra <me@erikkooistra.nl>
3 years agoMerge pull request #8583 from idryzhov/fix-topotest
Rafael Zalamena [Wed, 28 Apr 2021 10:16:43 +0000 (07:16 -0300)]
Merge pull request #8583 from idryzhov/fix-topotest

tests: fix topotest polling log

3 years agoMerge pull request #8471 from idryzhov/cleanup-num-named-lists
Donatas Abraitis [Wed, 28 Apr 2021 05:33:24 +0000 (08:33 +0300)]
Merge pull request #8471 from idryzhov/cleanup-num-named-lists

*: cleanup number-named access-lists and prefix-lists

3 years agotests: fix topotest polling log
Igor Ryzhov [Tue, 27 Apr 2021 23:52:58 +0000 (02:52 +0300)]
tests: fix topotest polling log

The current log prints maximum wait time which is not actually correct,
because it doesn't include the command execution time. We usually have
"failed after X seconds" log with X being far longer than this maximum.

Let's print the maximum number of tries instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8531 from mjstapp/fix_backups_misc
Russ White [Tue, 27 Apr 2021 20:04:24 +0000 (16:04 -0400)]
Merge pull request #8531 from mjstapp/fix_backups_misc

zebra: Misc fixups for backup nexthops

3 years agoMerge pull request #8527 from opensourcerouting/fixes-20210421
Russ White [Tue, 27 Apr 2021 19:14:12 +0000 (15:14 -0400)]
Merge pull request #8527 from opensourcerouting/fixes-20210421

lib: fix zlog assert() & CLI node_exit

3 years agoMerge pull request #8487 from pguibert6WIND/ospf6_vrfs
Russ White [Tue, 27 Apr 2021 19:06:11 +0000 (15:06 -0400)]
Merge pull request #8487 from pguibert6WIND/ospf6_vrfs

ospf6d: add 'show ipv6 ospf6 vrfs' command

3 years agoMerge pull request #8572 from opensourcerouting/pthread-autoconf
Mark Stapp [Tue, 27 Apr 2021 17:50:18 +0000 (13:50 -0400)]
Merge pull request #8572 from opensourcerouting/pthread-autoconf

build: fix pthread CFLAGS for function checks

3 years agoMerge pull request #8488 from mjstapp/more_workqueue
Stephen Worley [Tue, 27 Apr 2021 15:59:33 +0000 (11:59 -0400)]
Merge pull request #8488 from mjstapp/more_workqueue

lib, zebra: use zebra workqueue for NHG updates

3 years agobuild: fix pthread CFLAGS for function checks
David Lamparter [Tue, 27 Apr 2021 13:11:33 +0000 (15:11 +0200)]
build: fix pthread CFLAGS for function checks

The pthread_* checks for extra pthread features really need
PTHREAD_CFLAGS...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotests: Add pytest bgpd markers for recent BGP tests
Donatas Abraitis [Fri, 23 Apr 2021 13:47:47 +0000 (16:47 +0300)]
tests: Add pytest bgpd markers for recent BGP tests

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8553 from idryzhov/fix-bgp-get
Donatas Abraitis [Tue, 27 Apr 2021 06:22:08 +0000 (09:22 +0300)]
Merge pull request #8553 from idryzhov/fix-bgp-get

bgpd: fix bgp_get_vty return values

3 years agoMerge pull request #8517 from volta-networks/ldp_defer_zebra_updates
Renato Westphal [Tue, 27 Apr 2021 02:57:57 +0000 (23:57 -0300)]
Merge pull request #8517 from volta-networks/ldp_defer_zebra_updates

ldpd: defer register for info until configured

3 years agoMerge pull request #8538 from mjstapp/re_dump_nh_labels
Renato Westphal [Tue, 27 Apr 2021 02:57:03 +0000 (23:57 -0300)]
Merge pull request #8538 from mjstapp/re_dump_nh_labels

zebra: include nexthops' label stacks in zebra rib debug

3 years agoMerge pull request #8565 from mjstapp/fix_eigrp_tlvs
Donald Sharp [Mon, 26 Apr 2021 23:38:01 +0000 (19:38 -0400)]
Merge pull request #8565 from mjstapp/fix_eigrp_tlvs

eigrpd: validate TLV lengths

3 years agobgpd: fix bgp_get_vty return values
Igor Ryzhov [Fri, 23 Apr 2021 18:36:12 +0000 (21:36 +0300)]
bgpd: fix bgp_get_vty return values

There are multiple problems:
- commit ef7c53e2 introduced a new return value 2 which broke things,
  because a lot of code treats non-zero return as an error,
- there is an incorrect error returned when AS number mismatches.

This commit fixes both.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8548 from donaldsharp/bgp_dampening
Igor Ryzhov [Mon, 26 Apr 2021 20:13:05 +0000 (23:13 +0300)]
Merge pull request #8548 from donaldsharp/bgp_dampening

bgpd: prevent doppelganger overwrite of subsuquently configured cli

3 years agoMerge pull request #8520 from donaldsharp/ecmp_doc_change
Mark Stapp [Mon, 26 Apr 2021 15:26:18 +0000 (11:26 -0400)]
Merge pull request #8520 from donaldsharp/ecmp_doc_change

zebra: Add some flavor documentation for ECMP in zebra

3 years agoeigrpd: validate TLV lengths
Mark Stapp [Mon, 26 Apr 2021 15:20:57 +0000 (11:20 -0400)]
eigrpd: validate TLV lengths

Check that incoming TLVS a) don't overrun the incoming packet,
b) don't underrun the required size for the type of TLV.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #8549 from sworleys/NHG-Grace-Fix
Mark Stapp [Mon, 26 Apr 2021 12:34:31 +0000 (08:34 -0400)]
Merge pull request #8549 from sworleys/NHG-Grace-Fix

zebra: Proto-NHG Fix Graceful-Restart-Retain Crash Loop

3 years agoMerge pull request #8534 from opensourcerouting/threads-vs-fork
Mark Stapp [Mon, 26 Apr 2021 11:57:15 +0000 (07:57 -0400)]
Merge pull request #8534 from opensourcerouting/threads-vs-fork

lib, pathd PCEP: creating threads before forking does _not_ work

3 years agoMerge pull request #8540 from donaldsharp/kill_them_all
Rafael Zalamena [Mon, 26 Apr 2021 11:52:38 +0000 (11:52 +0000)]
Merge pull request #8540 from donaldsharp/kill_them_all

tests: Remove kill_mininet_router_process

3 years agoMerge pull request #8555 from idryzhov/fix-bfd-test
Rafael Zalamena [Mon, 26 Apr 2021 11:49:00 +0000 (11:49 +0000)]
Merge pull request #8555 from idryzhov/fix-bfd-test

tests: fix bfd-bgp-cbit-topo3 test

3 years agozebra: debug log for redistribute_del
Emanuele Di Pascale [Fri, 23 Apr 2021 08:49:07 +0000 (10:49 +0200)]
zebra: debug log for redistribute_del

We're firing an event debug log for zebra_redistribute_add, but not one
for zebra_redistribute_delete. Let's make it symmetric.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agoldpd: defer register for info until configured
Fredi Raspall [Thu, 18 Feb 2021 22:45:08 +0000 (23:45 +0100)]
ldpd: defer register for info until configured

Instead of registering to receive default-VRF information and routes
when first connected to zebra, defer the registration until some ldp
configuration is entered.

This avoids redistributing IPv4/IPv6 routes to ldpd when not needed.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agoMerge pull request #8526 from donaldsharp/sysctl_doc
Donatas Abraitis [Sun, 25 Apr 2021 08:54:13 +0000 (11:54 +0300)]
Merge pull request #8526 from donaldsharp/sysctl_doc

doc: Start talking about useful sysctl's for proper zebra operation

3 years agoMerge pull request #8543 from volta-networks/fix_bgp_invalid_nexthop
Donatas Abraitis [Sun, 25 Apr 2021 08:52:19 +0000 (11:52 +0300)]
Merge pull request #8543 from volta-networks/fix_bgp_invalid_nexthop

bgpd: fix invalid labeled nexthop check

3 years agobgpd: Prevent race condition loss of config
Donald Sharp [Sat, 24 Apr 2021 03:50:31 +0000 (23:50 -0400)]
bgpd: Prevent race condition loss of config

If we have a situation where BGP is partially reading in a config
file for a neighbor, *and* the neighbor is coming up *and* we
have a doppelganger.  There exists a race condition when we transfer
the config from the doppelganger to the config peer that we will
overwrite later config because we are copying the config data
from the doppelganger peer( which was captured at the start of initiation
of the peering ).

From what I can tell the peer->af_flags variable is to hold configuration
flags for the local peer.  The doppelganger should never overwrite this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: fix bfd-bgp-cbit-topo3 test
Igor Ryzhov [Fri, 23 Apr 2021 22:32:53 +0000 (01:32 +0300)]
tests: fix bfd-bgp-cbit-topo3 test

This test is completely incorrect on test_bfd_loss_intermediate step.
It shuts down the interface and then "waiting" for the BGP session to
fail. But instead of the actual wait it compares the output of "show bfd
peers" with the "up" state. As it does this comparison right after the
interface shutdown, the BFD session has not yet failed and the comparison
is always successful except very rare cases when the command takes a lot
of time to execute (due to the heavy load on CI system I suppose).

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8495 from opensourcerouting/ospfv3-bfd-rework
Igor Ryzhov [Fri, 23 Apr 2021 21:47:31 +0000 (00:47 +0300)]
Merge pull request #8495 from opensourcerouting/ospfv3-bfd-rework

ospf6d: rework BFD integration and add BFD profiles support

3 years agoMerge pull request #8462 from opensourcerouting/pim-bfd-refactor
Igor Ryzhov [Fri, 23 Apr 2021 21:46:29 +0000 (00:46 +0300)]
Merge pull request #8462 from opensourcerouting/pim-bfd-refactor

pimd: rework BFD integration and add profile support

3 years agoMerge pull request #8539 from donaldsharp/isis_circuit_warning
Igor Ryzhov [Fri, 23 Apr 2021 19:44:49 +0000 (22:44 +0300)]
Merge pull request #8539 from donaldsharp/isis_circuit_warning

Isis circuit warning

3 years agoldpd: set `frr_is_after_fork` in lde/ldpe
David Lamparter [Fri, 23 Apr 2021 13:17:07 +0000 (15:17 +0200)]
ldpd: set `frr_is_after_fork` in lde/ldpe

These subprocesses don't use frr_config_fork(), so frr_is_after_fork is
never set.  While the frr_pthread stuff isn't currently used there, set
the flag anyway to avoid future headaches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoisisd: Remove warnings and add some data to debugs for isis_csm.c
Donald Sharp [Thu, 22 Apr 2021 19:04:15 +0000 (15:04 -0400)]
isisd: Remove warnings and add some data to debugs for isis_csm.c

When running isis and not running isis on all interfaces results
in a bunch of warn messages to the log about circuit state
changes.  These warn messages also didn't bother to inform
the end user what interface was causing the fun.  Since
the end operator cannot do anything with these warn messages
and nor should they in the vast array of normal operations
modify the code to use event debugging and turn the warns
to debugs.

Additionally add some information to clue the operator
in on to what actual interface we are talking about.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotopotests: test PIM BFD profile integration
Rafael Zalamena [Tue, 13 Apr 2021 14:33:39 +0000 (11:33 -0300)]
topotests: test PIM BFD profile integration

Test that PIM BFD profile integration works.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: document new PIM BFD command variant
Rafael Zalamena [Tue, 13 Apr 2021 14:53:50 +0000 (11:53 -0300)]
doc: document new PIM BFD command variant

Tell user he can configure BFD profile for sessions created by PIM.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: support BFD profiles configuration
Rafael Zalamena [Tue, 13 Apr 2021 14:07:01 +0000 (11:07 -0300)]
pimd: support BFD profiles configuration

Allow users to pre configure BFD sessions with a profile.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoyang: add PIM BFD profile support
Rafael Zalamena [Tue, 13 Apr 2021 13:43:19 +0000 (10:43 -0300)]
yang: add PIM BFD profile support

Allow users to configure BFD profile for the peers in a interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: add new basic PIM topology test
Rafael Zalamena [Mon, 12 Apr 2021 19:47:38 +0000 (16:47 -0300)]
topotests: add new basic PIM topology test

Test for PIM (re)convergence and BFD usage.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: rework BFD integration
Rafael Zalamena [Mon, 12 Apr 2021 16:48:21 +0000 (13:48 -0300)]
pimd: rework BFD integration

Rewrite the BFD integration code to use the new library.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agobgpd: fix invalid labeled nexthop check
Emanuele Di Pascale [Thu, 22 Apr 2021 17:04:47 +0000 (19:04 +0200)]
bgpd: fix invalid labeled nexthop check

the code processing an NHT update was only resetting the BGP_NEXTHOP_VALID
flag, so labeled nexthops were considered valid even if there was no
nexthop. Reset the flag in response to the update, and also make the
isvalid_nexthop functions a little more robust by checking the number
of nexthops.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agozebra: handle gracefulRS/retain with proto NHGs
Stephen Worley [Thu, 22 Apr 2021 21:21:12 +0000 (17:21 -0400)]
zebra: handle gracefulRS/retain with proto NHGs

Properly handle refcounting of Proto-owned NHGs when
zebra is operating under graceful restart and retain
conditions.

We have an extra refcnt of 1 we keep for proto-owned NHGs to
indicate the upper level proto has created and owns it.

When we are reading these in from the kernel, we need to set them
to 1 as appropriate. Without this, we fail in the assert() during
zebra_nhg_proto_add() after the owning daemons resends the NHG
and the refcnts are off by one.

Also add in the same logic we use for routes when sweeping with
respect to uptimes.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agozebra: add uptime to NHEs
Stephen Worley [Thu, 22 Apr 2021 21:19:03 +0000 (17:19 -0400)]
zebra: add uptime to NHEs

Add uptime for use with NHEs to keep track of how
long we have had this NHE in our rib without an update.

This is treated exactly the same as the re->uptime for
routes. When we get an update for a route, we reset the
uptime.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agozebra: add PROTO_OWNED macro for NHE id bounds checking
Stephen Worley [Thu, 22 Apr 2021 21:16:57 +0000 (17:16 -0400)]
zebra: add PROTO_OWNED macro for NHE id bounds checking

Add a PROTO_OWNED macro for code readability when checking
ID bounds for whether a NHG is proto owned.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agotests: Remove kill_mininet_router_process
Donald Sharp [Thu, 22 Apr 2021 19:47:37 +0000 (15:47 -0400)]
tests: Remove kill_mininet_router_process

This function kills all processes that happen to have the same
name to frr processes and it was only ever used in the setup.
Setup should not be used to kill old runs.  That should be a
separate process.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: Use enum for circuit state
Donald Sharp [Thu, 22 Apr 2021 18:52:40 +0000 (14:52 -0400)]
isisd: Use enum for circuit state

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: use an enum for circuit states
Donald Sharp [Thu, 22 Apr 2021 18:46:53 +0000 (14:46 -0400)]
isisd: use an enum for circuit states

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: BFD session handling improvement
Rafael Zalamena [Wed, 21 Apr 2021 18:27:20 +0000 (15:27 -0300)]
lib: BFD session handling improvement

Don't uninstall sessions if the address, interface, VRF or TTL didn't change.

Update the library documentation to make it clear to other developers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: OSPFv3 BFD profile documentation
Rafael Zalamena [Fri, 16 Apr 2021 20:02:13 +0000 (17:02 -0300)]
doc: OSPFv3 BFD profile documentation

Let user know he can use BFD profiles with OSPFv3.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: test OSPFv3 BFD profiles
Rafael Zalamena [Fri, 16 Apr 2021 19:17:58 +0000 (16:17 -0300)]
topotests: test OSPFv3 BFD profiles

See if the BFD sessions created by OSPFv3 are using the configured BFD profiles.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospf6d: add support for BFD profiles
Rafael Zalamena [Fri, 16 Apr 2021 19:17:31 +0000 (16:17 -0300)]
ospf6d: add support for BFD profiles

Allow user to pre configure BFD sessions using profiles.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: converge OSPFv3 faster
Rafael Zalamena [Thu, 15 Apr 2021 20:34:48 +0000 (17:34 -0300)]
topotests: converge OSPFv3 faster

Tweak OSPFv3 interface configuration to converge faster.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospf6d: rework BFD integration
Rafael Zalamena [Wed, 14 Apr 2021 15:37:01 +0000 (12:37 -0300)]
ospf6d: rework BFD integration

Use the new BFD library to integrate with BFD.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib: fix possible crash on BFD notification
Rafael Zalamena [Mon, 12 Apr 2021 20:59:52 +0000 (17:59 -0300)]
lib: fix possible crash on BFD notification

Allow sessions to remove themselves from the notifications without
risking crashes.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoMerge pull request #8536 from idryzhov/bfd-enabled
Rafael Zalamena [Thu, 22 Apr 2021 18:06:48 +0000 (15:06 -0300)]
Merge pull request #8536 from idryzhov/bfd-enabled

lib: remove enabled flag for bfd sessions

3 years agozebra: include nexthops' label stacks in debugs
Mark Stapp [Thu, 22 Apr 2021 15:51:50 +0000 (11:51 -0400)]
zebra: include nexthops' label stacks in debugs

Include nexthops' labels in an important debug early in
route processing.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: remove enabled flag for bfd sessions
Igor Ryzhov [Thu, 22 Apr 2021 12:24:49 +0000 (15:24 +0300)]
lib: remove enabled flag for bfd sessions

Currently this flag is only helpful in an extremely rare situation when
the BFD session registration was unsuccessful and after that zebra is
restarted. Let's remove this flag to simplify the API. If we ever want
to solve the problem of unsuccessful registration/deregistration, this
can be done using internal flags, without API modification.

Also add the error log to help user understand why the BFD session is
not working.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: hard-fail creating threads before fork()
David Lamparter [Thu, 22 Apr 2021 10:10:27 +0000 (12:10 +0200)]
lib: hard-fail creating threads before fork()

Creating any threads before we fork() into the background (if `-d` is
given) is an extremely dangerous footgun;  the threads are created in
the parent and terminated when that exits.

This is extra dangerous because while testing, you'd often run the
daemon in foreground without `-d`, and everything works as expected.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agopathd: don't init PCEP before fork()
David Lamparter [Thu, 22 Apr 2021 10:17:42 +0000 (12:17 +0200)]
pathd: don't init PCEP before fork()

Turns out the PCEP stuff does not work particularly well if its threads
are ... missing.  Who would've thought?

Reported-by: Erik Kooistra <me@erikkooistra.nl>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add frr_config_pre hook
David Lamparter [Thu, 22 Apr 2021 11:18:19 +0000 (13:18 +0200)]
lib: add frr_config_pre hook

... for any initialization that needs to run after forking, but that
would be racy if it were just scheduled on the thread_master (since the
config load is also just a thread callback, ordering would be undefined
for another scheduled thread callback.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: rename very_late_init hook to config_post
David Lamparter [Thu, 22 Apr 2021 10:06:51 +0000 (12:06 +0200)]
lib: rename very_late_init hook to config_post

very_late_init doesn't really say what this does, config_post is much
more descriptive.  (A config_pre is coming in a jiffy.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>