]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agotools: add frr_babeltrace.py to /usr/lib/frr
Anuradha Karuppiah [Fri, 1 Oct 2021 16:52:24 +0000 (09:52 -0700)]
tools: add frr_babeltrace.py to /usr/lib/frr

Make the script available as a part of the FRR package install for
ease of use.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2 years agobgpd: lttng tracepoint for local events received from zebra
Anuradha Karuppiah [Mon, 4 Oct 2021 16:41:43 +0000 (09:41 -0700)]
bgpd: lttng tracepoint for local events received from zebra

TPs -
=====
root@ibm-2410a1-01:mgmt:~# lttng list --userspace |grep frr_bgp:evpn.*recv
      frr_bgp:evpn_local_l3vni_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_l3vni_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_macip_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_macip_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_vni_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_vni_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_evi_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_evi_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
root@ibm-2410a1-01:mgmt:~#

Sample output -
===============
1. ES
frr_bgp:evpn_mh_local_es_add_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vtep': '27.0.0.15', 'active': 0, 'bypass': 0, 'df_pref': 50000}
frr_bgp:evpn_mh_local_es_del_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01'}

2. ES-EVI
frr_bgp:evpn_mh_local_es_evi_add_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 1004}
frr_bgp:evpn_mh_local_es_evi_del_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 1001}

3. L2-VNI
frr_bgp:evpn_local_vni_add_zrecv {'vni': 1004, 'vtep': '27.0.0.15', 'mc_grp': '239.1.1.104', 'vrf': 97}

4. L3-VNI
frr_bgp:evpn_local_l3vni_add_zrecv {'vni': 4001, 'vrf': 87, 'svi_rmac': '24:8a:07:cc:aa:5f', 'vrr_rmac': '24:8a:07:cc:aa:5f', 'vtep': '27.0.0.15', 'filter': 0, 'svi_ifindex': 95, 'anycast_mac': 'n'
frr_bgp:evpn_local_l3vni_del_zrecv {'vni': 4003, 'vrf': 107}

5. MAC-IP
frr_bgp:evpn_local_macip_add_zrecv {'vni': 1003, 'mac': '00:02:00:00:00:04', 'ip': 'fe80::202:ff:fe00:4', 'flags': 4, 'seq': 0, 'esi': '03:44:38:39:ff:ff:01:00:00:02'}
frr_bgp:evpn_local_macip_del_zrecv {'vni': 1000, 'mac': '00:02:00:00:00:04', 'ip': '2001:fee1::4', 'state': 1}

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2 years agoMerge pull request #9813 from opensourcerouting/ospf-gr-fixes
Donald Sharp [Fri, 15 Oct 2021 13:21:40 +0000 (09:21 -0400)]
Merge pull request #9813 from opensourcerouting/ospf-gr-fixes

ospfd: more GR fixes

2 years agoMerge pull request #9836 from opensourcerouting/doc-developer-fixes
Donald Sharp [Fri, 15 Oct 2021 13:16:27 +0000 (09:16 -0400)]
Merge pull request #9836 from opensourcerouting/doc-developer-fixes

doc/developer: fix random sphinx warnings/typos/…

2 years agoMerge pull request #9826 from donaldsharp/isis_signed
Igor Ryzhov [Fri, 15 Oct 2021 09:51:04 +0000 (12:51 +0300)]
Merge pull request #9826 from donaldsharp/isis_signed

warnings that should be fixed in our compiles

2 years agoMerge pull request #9834 from idryzhov/pbr-null-deref
Donatas Abraitis [Fri, 15 Oct 2021 09:01:00 +0000 (12:01 +0300)]
Merge pull request #9834 from idryzhov/pbr-null-deref

pbrd: protect from a possible NULL dereference

2 years agoMerge pull request #9835 from idryzhov/ospf6-no-op
Donatas Abraitis [Fri, 15 Oct 2021 09:00:51 +0000 (12:00 +0300)]
Merge pull request #9835 from idryzhov/ospf6-no-op

ospf6d: remove no-op

2 years agodoc/developer: fix duplicate const prototypes
David Lamparter [Thu, 14 Oct 2021 17:19:23 +0000 (19:19 +0200)]
doc/developer: fix duplicate const prototypes

The const ones have const in the name.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agodoc/developer: use :c:macro: where appropriate
David Lamparter [Thu, 14 Oct 2021 17:17:30 +0000 (19:17 +0200)]
doc/developer: use :c:macro: where appropriate

Sphinx tries to parse :c:function: as function prototype, which doesn't
quite work with macros.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agodoc/developer: fix warnings in topotests doc
David Lamparter [Thu, 14 Oct 2021 17:11:02 +0000 (19:11 +0200)]
doc/developer: fix warnings in topotests doc

Sphinx warns about a few nits here, just fix.  (Note :option:`-E` can't
be used without a "option:: -E" definition, it's intended as a cross
reference.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agodoc/developer: fix C struct references
David Lamparter [Thu, 14 Oct 2021 17:02:03 +0000 (19:02 +0200)]
doc/developer: fix C struct references

Sphinx wants `c:struct:: foo` rather than `c:type:: struct foo`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoospf6d: remove no-op
Igor Ryzhov [Thu, 14 Oct 2021 16:47:02 +0000 (19:47 +0300)]
ospf6d: remove no-op

ospf6_route_create already sets route->ospf6.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agopbrd: protect from a possible NULL dereference
Igor Ryzhov [Thu, 14 Oct 2021 16:45:43 +0000 (19:45 +0300)]
pbrd: protect from a possible NULL dereference

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9817 from donaldsharp/link_type_ordering
Donatas Abraitis [Thu, 14 Oct 2021 13:25:02 +0000 (16:25 +0300)]
Merge pull request #9817 from donaldsharp/link_type_ordering

lib: Add missing enum values in switch statement for if_link_type_str

2 years agoMerge pull request #9825 from donaldsharp/one_sleep_twice_shy
Donatas Abraitis [Thu, 14 Oct 2021 12:31:23 +0000 (15:31 +0300)]
Merge pull request #9825 from donaldsharp/one_sleep_twice_shy

tests: BFD timing tests under system load need more leeway

2 years agoMerge pull request #9684 from opensourcerouting/printfrr-false-positive
Donald Sharp [Thu, 14 Oct 2021 11:34:20 +0000 (07:34 -0400)]
Merge pull request #9684 from opensourcerouting/printfrr-false-positive

*: `frr-format` with unmodified GCC

2 years agoMerge pull request #9759 from opensourcerouting/workflow-dev-tag
Donald Sharp [Thu, 14 Oct 2021 11:33:09 +0000 (07:33 -0400)]
Merge pull request #9759 from opensourcerouting/workflow-dev-tag

doc/developer: document dev tag on master

2 years agoMerge pull request #9822 from donaldsharp/ospf_testing
Renato Westphal [Thu, 14 Oct 2021 02:38:44 +0000 (23:38 -0300)]
Merge pull request #9822 from donaldsharp/ospf_testing

Ospf testing

2 years agoMerge pull request #9812 from donaldsharp/python_3_clippy_build
David Lamparter [Thu, 14 Oct 2021 00:40:38 +0000 (02:40 +0200)]
Merge pull request #9812 from donaldsharp/python_3_clippy_build

2 years agoMerge pull request #9751 from ewlumpkin/comment_spelling_fixes
Igor Ryzhov [Wed, 13 Oct 2021 23:05:44 +0000 (02:05 +0300)]
Merge pull request #9751 from ewlumpkin/comment_spelling_fixes

lib: fix spelling nits in more lib files' comments

2 years agoMerge pull request #9761 from mjstapp/fix_topo_debug_cli
Igor Ryzhov [Wed, 13 Oct 2021 22:48:41 +0000 (01:48 +0300)]
Merge pull request #9761 from mjstapp/fix_topo_debug_cli

tests: remove deprecated debug cli references

2 years agoMerge pull request #9796 from mjstapp/fix_topo_isis_vrf_cmds
Igor Ryzhov [Wed, 13 Oct 2021 22:44:03 +0000 (01:44 +0300)]
Merge pull request #9796 from mjstapp/fix_topo_isis_vrf_cmds

tests: in isis_topo1_vrf, only configure valid interfaces

2 years agoMerge pull request #9795 from opensourcerouting/ospf_get_name
Igor Ryzhov [Wed, 13 Oct 2021 22:42:29 +0000 (01:42 +0300)]
Merge pull request #9795 from opensourcerouting/ospf_get_name

ospfd: use ospf_get_name() wherever possible

2 years agoMerge pull request #9676 from donaldsharp/import_register
David Lamparter [Wed, 13 Oct 2021 20:28:03 +0000 (22:28 +0200)]
Merge pull request #9676 from donaldsharp/import_register

2 years agoMerge pull request #9768 from ton31337/feature/catch_double_pointer_thread
Mark Stapp [Wed, 13 Oct 2021 20:19:33 +0000 (16:19 -0400)]
Merge pull request #9768 from ton31337/feature/catch_double_pointer_thread

tools: Catch double pointer of struct thread towards thread_add_*

2 years agobabeld: Prevent compiler warning about uninited value for n
Donald Sharp [Wed, 13 Oct 2021 18:34:08 +0000 (14:34 -0400)]
babeld: Prevent compiler warning about uninited value for n

the variable n, when used must have been set via the find_route_slot
but the compiler in question is probably getting confused with the
multiple levels of indention.  Just get around the whole problem
by setting n = 0 and being done with it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoisisd: Convert signed to time_t for addition
Donald Sharp [Wed, 13 Oct 2021 18:32:52 +0000 (14:32 -0400)]
isisd: Convert signed to time_t for addition

Convert a signed value to a time_t before addition
so that we can compare unsigned (time_t) to unsigned.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: BFD timing tests under system load need more leeway
Donald Sharp [Wed, 13 Oct 2021 18:12:51 +0000 (14:12 -0400)]
tests: BFD timing tests under system load need more leeway

We have this pattern in this test:

    # Let's kill the interface on rt2 and see what happens with the RIB and BFD on rt1
    tgen.gears["rt2"].link_enable("eth-rt1", enabled=False)

    # By default BFD provides a recovery time of 900ms plus jitter, so let's wait
    # initial 2 seconds to let the CI not suffer.
    topotest.sleep(2, 'Wait for BFD down notification')

    router_compare_json_output(
        "rt1", "show ip route ospf json", "step3/show_ip_route_rt2_down.ref", 1, 0
    )

Under a heavy CI load, interface down events and then reacting to them may not actually
happen within 2 seconds.  Allow some more grace time in the test to ensure that we
react to it in an appropriate manner.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9819 from donaldsharp/deprecation_python
Russ White [Wed, 13 Oct 2021 17:55:06 +0000 (13:55 -0400)]
Merge pull request #9819 from donaldsharp/deprecation_python

tests: Fix `Invalid escape sequence` warnings in test runs

2 years agotests: Convert over to using converged to test for ospf being converged
Donald Sharp [Wed, 13 Oct 2021 16:46:22 +0000 (12:46 -0400)]
tests: Convert over to using converged to test for ospf being converged

OSPF when it is deciding on whom it should elect for DR and backup
has a process that prioritizes network stabilty over the exact
same results of who is the DR / Backups.

Essentially if we have r1 ----- r2

Let's say r1 has a higher priority, but r2 comes up first, starts
sending hello packets and then decides that it is the DR.  At some
point in time in the future, r1 comes up and then connects to r2
at that point it sees that r2 has elected itself DR and it keeps
it that way.

This is by design of the system.  With our tight ospf timers as
well as high load being experienced on our test systems.  There
exists a bunch of ospf tests that we cannot guarantee that a
consistent DR will be elected for the test.  As such let's not
even pretend that we care a bunch and just look for `Full`.
If we care about `ordering` we need to spend more time getting
the tests to actually start routers, ensure that htey are up and
running in the right order so that priority can take place.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: Add `converged` and `role` json output for neighbor command
Donald Sharp [Wed, 13 Oct 2021 16:40:35 +0000 (12:40 -0400)]
ospfd: Add `converged` and `role` json output for neighbor command

The `show ip ospf neighbor json` command was displaying
state:`Full\/DR`

Where state was both the role and whether or not the neigbhor
was converged.  While from a OSPF perspective this is the state.
This state is a combination of two things.

This creates a problem in testing because we have no guarantee
that a particular ospf router will actually have a particular role
given how loaded our topotest systems are.  So add a bit of json
output to display both the converged status as well as the
role this router is playing on this neighbor/interface.

The above becomes:
state:`Full\/DR`
converged:`Full`
role:`DR`

Tests can now be modified to look for `Full` and allow it to
continue.  Most of the tests do not actually care if this
router is the DR or Backup.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9806 from jonglezb/master
Donald Sharp [Wed, 13 Oct 2021 14:16:45 +0000 (10:16 -0400)]
Merge pull request #9806 from jonglezb/master

doc: Add missing static route options and clarify usage

2 years agotests: Fix `Invalid escape sequence` warnings in test runs
Donald Sharp [Wed, 13 Oct 2021 13:03:27 +0000 (09:03 -0400)]
tests: Fix `Invalid escape sequence` warnings in test runs

Test runs are creating these warnings:
bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls
  <string>:7: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls
  <string>:19: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up
  <string>:24: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up
  <string>:191: DeprecationWarning: invalid escape sequence \d

-- Docs: https://docs.pytest.org/en/stable/warnings.html

Find and destroy these warnings

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Add missing enum values in switch statement for if_link_type_str
Donald Sharp [Wed, 13 Oct 2021 11:58:37 +0000 (07:58 -0400)]
lib: Add missing enum values in switch statement for if_link_type_str

The switch statement over `enum zebra_link_type` had a default
and FRR was missing a few of the pre-defined types we cared about.
Remove the default statement and add the missing values.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9715 from idryzhov/cleanup-number-named-acl
Donatas Abraitis [Wed, 13 Oct 2021 07:00:43 +0000 (10:00 +0300)]
Merge pull request #9715 from idryzhov/cleanup-number-named-acl

*: cleanup number-named access-lists in CLI

2 years agoospfd: fix another DR election issue during graceful restart
Renato Westphal [Tue, 12 Oct 2021 19:08:23 +0000 (16:08 -0300)]
ospfd: fix another DR election issue during graceful restart

Commit 3551ee9e90304 introduced a regression that causes GR to fail
under certain circumstances. In short, while ISM events should
be ignored while acting as a helper for a restarting router, the
DR/BDR fields of the neighbor structure should still be updated
while processing a Hello packet. If that isn't done, it can cause
the helper to elect the wrong DR while exiting from the helper mode,
leading to a situation where there are two DRs for the same network
segment (and a failed GR by consequence). Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospfd: introduce additional opaque capability check in the GR code
Renato Westphal [Sat, 9 Oct 2021 23:02:16 +0000 (20:02 -0300)]
ospfd: introduce additional opaque capability check in the GR code

Before starting the graceful restart procedures, ospf_gr_prepare()
verifies for each configured OSPF instance whether it has the opaque
capability enabled (a pre-requisite for GR). If not, a warning is
emitted and GR isn't performed on that instance.

This PR introduces an additional opaque capability check that will
return a CLI error when the opaque capability isn't enabled. The
idea is to make it easier for the user to identify when the GR
activation has failed, instead of requiring him or her to check
the logs for errors.

The original opaque capability check from ospf_gr_prepare() was
retaining as it's possible that that function might be called from
other contexts in the future.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: fix LSA name in debug message
Renato Westphal [Sat, 9 Oct 2021 21:59:58 +0000 (18:59 -0300)]
ospf6d: fix LSA name in debug message

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospfd: fix flushing of Grace-LSAs on broadcast interfaces
Renato Westphal [Fri, 8 Oct 2021 12:05:28 +0000 (09:05 -0300)]
ospfd: fix flushing of Grace-LSAs on broadcast interfaces

The ospfd opaque LSA infrastruture has an issue where it can't store
different versions of the same Type-9 LSA for different interfaces.

When flushing the self-originated Grace-LSAs upon exiting from the GR
mode, the code was looking up the single self-originated Grace-LSA
from the LSDB, setting its age to MaxAge and sending it out on all
interfaces.

The problem is that Grace-LSAs sent on broadcast interfaces have
their own unique "IP interface address" TLV that is used to identify
the restarting router. That way, just reusing the same Grace-LSA for
all interfaces doesn't work.

Fix this by generating a new Grace-LSA with its age manually set
to MaxAge whenever one needs to be flushed. This will allow the "IP
interface address" TLV to be set correctly and make GR work even in
the presence of multiple broadcast interfaces.

In the long term, the opaque LSA infrastructure should be updated
to support Type-9 link-local LSAs correctly so that we don't need to
resort to hacks like this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years ago*: If building clippy we must have python3
Donald Sharp [Tue, 12 Oct 2021 19:41:07 +0000 (15:41 -0400)]
*: If building clippy we must have python3

When building clippy we must have python 3.  Let's
ensure that we test for it and stop the auto-make
if it is not installed on the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9655 from yyuanam/first_commit
Jafar Al-Gharaibeh [Tue, 12 Oct 2021 16:15:39 +0000 (11:15 -0500)]
Merge pull request #9655 from yyuanam/first_commit

Zebra: Ignore the failure of startup intf lookup.

2 years agoMerge pull request #9686 from idryzhov/fix-nda-lladdr
Donald Sharp [Tue, 12 Oct 2021 16:04:00 +0000 (12:04 -0400)]
Merge pull request #9686 from idryzhov/fix-nda-lladdr

zebra: fix buffer overflow

2 years agoMerge pull request #9763 from ton31337/fix/more_thread_null
Russ White [Tue, 12 Oct 2021 15:49:46 +0000 (11:49 -0400)]
Merge pull request #9763 from ton31337/fix/more_thread_null

More struct thread null

2 years agodoc: Add missing static route options and clarify usage
Baptiste Jonglez [Tue, 12 Oct 2021 15:20:08 +0000 (17:20 +0200)]
doc: Add missing static route options and clarify usage

* Add missing "blackhole" and "reject" options
* Add missing GATEWAY + IFNAME usage
* Add missing "onlink" option
* Explicit all possible usage patterns of static routes
* Clarify description of each option

Signed-off-by: Baptiste Jonglez <baptiste.jonglez@inria.fr>
2 years agoMerge pull request #9779 from donaldsharp/gr_repeated
Russ White [Tue, 12 Oct 2021 15:00:44 +0000 (11:00 -0400)]
Merge pull request #9779 from donaldsharp/gr_repeated

Some GR fixes

2 years agoMerge pull request #9781 from opensourcerouting/ospfd-gr-dr-fix
Russ White [Tue, 12 Oct 2021 14:58:39 +0000 (10:58 -0400)]
Merge pull request #9781 from opensourcerouting/ospfd-gr-dr-fix

ospfd: preserve DR status across graceful restarts

2 years agotests: in isis_topo1_vrf, only configure valid interfaces
Mark Stapp [Mon, 11 Oct 2021 15:57:30 +0000 (11:57 -0400)]
tests: in isis_topo1_vrf, only configure valid interfaces

Fix a loop in the setup phase of isis_topo1_vrf: only configure
interfaces that each router actually has.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #9788 from idryzhov/ospf6-clear-interface-vrf
Renato Westphal [Mon, 11 Oct 2021 15:19:09 +0000 (12:19 -0300)]
Merge pull request #9788 from idryzhov/ospf6-clear-interface-vrf

ospf6d: add missing vrf parameter to "clear ipv6 ospf6 interface"

2 years agoMerge pull request #9789 from idryzhov/if-ll-type
Mark Stapp [Mon, 11 Oct 2021 12:57:26 +0000 (08:57 -0400)]
Merge pull request #9789 from idryzhov/if-ll-type

lib: set type for newly created interfaces

2 years agoMerge pull request #9780 from idryzhov/bgp-local-pointer
Donatas Abraitis [Mon, 11 Oct 2021 09:13:09 +0000 (12:13 +0300)]
Merge pull request #9780 from idryzhov/bgp-local-pointer

bgpd: don't return pointer to a local variable

2 years agoospfd: use ospf_get_name() wherever possible
Renato Westphal [Sat, 9 Oct 2021 23:36:47 +0000 (20:36 -0300)]
ospfd: use ospf_get_name() wherever possible

Small cleanup to reduce code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: add missing vrf parameter to "clear ipv6 ospf6 interface"
Igor Ryzhov [Fri, 8 Oct 2021 18:36:14 +0000 (21:36 +0300)]
ospf6d: add missing vrf parameter to "clear ipv6 ospf6 interface"

Currently, it's not possible to run this command in any VRF other than default.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agolib: set type for newly created interfaces
Igor Ryzhov [Fri, 8 Oct 2021 21:22:31 +0000 (00:22 +0300)]
lib: set type for newly created interfaces

Currently, the ll_type is set only in `netlink_interface` which is
executed only during startup. If the interface is created when the FRR
is already running, the type is not stored.

Fixes #1164.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9760 from mobash-rasool/ospfv2-bug-fixes-02
Russ White [Fri, 8 Oct 2021 17:55:28 +0000 (13:55 -0400)]
Merge pull request #9760 from mobash-rasool/ospfv2-bug-fixes-02

ospfd: ospf nbr in full although mismatch in hello packet contents

2 years agoMerge pull request #9764 from idryzhov/thread-add-local
Russ White [Fri, 8 Oct 2021 17:54:23 +0000 (13:54 -0400)]
Merge pull request #9764 from idryzhov/thread-add-local

*: don't pass pointers to a local variables to thread_add_*

2 years agoMerge pull request #9471 from pguibert6WIND/table_manager_alloc2
Russ White [Fri, 8 Oct 2021 17:49:54 +0000 (13:49 -0400)]
Merge pull request #9471 from pguibert6WIND/table_manager_alloc2

zebra: extend table manager per vrf, add vty configuration

2 years agotests: check for received Grace-LSAs on the OSPF GR topotests
Renato Westphal [Fri, 8 Oct 2021 00:00:06 +0000 (21:00 -0300)]
tests: check for received Grace-LSAs on the OSPF GR topotests

Ensure GR helpers have received a Grace-LSA before killing the
ospfd/ospf6d process that is undergoing a graceful restart.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoMerge pull request #9774 from idryzhov/bgp-show-crash
Donald Sharp [Fri, 8 Oct 2021 16:38:08 +0000 (12:38 -0400)]
Merge pull request #9774 from idryzhov/bgp-show-crash

bgpd: fix crash when using "show bgp vrf all"

2 years ago*: cleanup number-named access-lists in CLI
Igor Ryzhov [Fri, 1 Oct 2021 15:35:11 +0000 (18:35 +0300)]
*: cleanup number-named access-lists in CLI

There's no more difference between number-named and word-named access-lists.
This commit removes separate arguments for number-named ACLs from CLI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9693 from donaldsharp/bgp_address_removal
Donatas Abraitis [Fri, 8 Oct 2021 14:41:59 +0000 (17:41 +0300)]
Merge pull request #9693 from donaldsharp/bgp_address_removal

bgpd: When removing v6 address being used as a nexthop ensure peer is…

2 years agoospfd: fix display of plain-text data on "show ... json" commands
Renato Westphal [Fri, 8 Oct 2021 00:06:01 +0000 (21:06 -0300)]
ospfd: fix display of plain-text data on "show ... json" commands

Add a 'json' parameter to the 'show_opaque_info' callback definition,
and update all instances of that callback to not display plain-text
data when the user requested JSON data.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospfd: display detailed information about opaque LSAs in JSON format
Renato Westphal [Fri, 8 Oct 2021 00:05:20 +0000 (21:05 -0300)]
ospfd: display detailed information about opaque LSAs in JSON format

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agotests: Fix ospf[6]_gr_topo1 tests to work better under load
Donald Sharp [Fri, 8 Oct 2021 11:37:15 +0000 (07:37 -0400)]
tests: Fix ospf[6]_gr_topo1 tests to work better under load

2 things:

a) Each test was setting up for graceful restart with calls to
`graceful-restart prepare ip[v6] ospf`, then sleeping for
3 or 5 seconds.  Then killing the ospf process.  Under heavy
load there is no guarantee that zebra has received/processed
this signal.  Write some code to ensure that this happens

b) Tests are issuing commands in this order:
   1) issue gr prepare command
   2) kill router
   3) <ensure routes were still installed in zebra>
   4) start router
   5) <ensure routes were stil installed in zebra>

Imagine that the system is under some load and there is
a small amount of time before step 5 happens.  In this
case ospf could have come up and started neighbor relations
and also started installing routes.  If zebra receives
a new route before step 5 is issued then the route could
be in a state where it is not installed, because it is
being sent to the kernel for installation.  This would
fail the test because it would only look 1 time.  This
is fixed by giving time on restart for the routes to
be in the installed state.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: preserve DR status across graceful restarts
Renato Westphal [Fri, 8 Oct 2021 02:45:31 +0000 (23:45 -0300)]
ospfd: preserve DR status across graceful restarts

RFC 3623 says:
 "If the restarting router determines that it was the Designated
 Router on a given segment prior to the restart, it elects
 itself as the Designated Router again.  The restarting router
 knows that it was the Designated Router if, while the
 associated interface is in Waiting state, a Hello packet is
 received from a neighbor listing the router as the Designated
 Router".

Implement that logic when processing Hello messages to ensure DR
interfaces will preserve their DR status across a graceful restart.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: don't return pointer to a local variable
Igor Ryzhov [Fri, 8 Oct 2021 11:51:15 +0000 (14:51 +0300)]
bgpd: don't return pointer to a local variable

CID 1507651.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agobgpd: fix crash when using "show bgp vrf all"
Igor Ryzhov [Thu, 7 Oct 2021 15:27:29 +0000 (18:27 +0300)]
bgpd: fix crash when using "show bgp vrf all"

Any command that uses `peer_lookup_in_view` crashes when "vrf all" is
used, because bgp is NULL in this case.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9727 from ton31337/feature/catch_struct_thread_xxx_against_NULL_c...
Igor Ryzhov [Fri, 8 Oct 2021 08:40:07 +0000 (11:40 +0300)]
Merge pull request #9727 from ton31337/feature/catch_struct_thread_xxx_against_NULL_coccinelle

bgpd: Don't set NULL for struct thread at bgp_dump_interval_func()

2 years agoospf6d: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Thu, 7 Oct 2021 10:25:43 +0000 (13:25 +0300)]
ospf6d: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoisisd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Thu, 7 Oct 2021 10:20:15 +0000 (13:20 +0300)]
isisd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Thu, 7 Oct 2021 09:25:59 +0000 (12:25 +0300)]
ospfd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agotests: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Thu, 7 Oct 2021 09:22:18 +0000 (12:22 +0300)]
tests: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9773 from idryzhov/bgp-show-prefix-filter-vrf
Donatas Abraitis [Fri, 8 Oct 2021 05:52:37 +0000 (08:52 +0300)]
Merge pull request #9773 from idryzhov/bgp-show-prefix-filter-vrf

bgpd: add missing vrf/view parameter to one command

2 years agoMerge pull request #9756 from donaldsharp/unchecked
Igor Ryzhov [Thu, 7 Oct 2021 22:08:03 +0000 (01:08 +0300)]
Merge pull request #9756 from donaldsharp/unchecked

2 years agoMerge pull request #9737 from idryzhov/yang-pattern
Quentin Young [Thu, 7 Oct 2021 18:29:07 +0000 (14:29 -0400)]
Merge pull request #9737 from idryzhov/yang-pattern

2 years agozebra: Display how long zebra is expected to wait for GR
Donald Sharp [Thu, 7 Oct 2021 16:08:42 +0000 (12:08 -0400)]
zebra: Display how long zebra is expected to wait for GR

When a client sends to zebra that GR mode is being turned
on.  The client also passes down the time zebra should hold
onto the routes.  Display this time with the output
of the `show zebra client` command as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: GR data was being printed 2 times for `show zebra client`
Donald Sharp [Thu, 7 Oct 2021 16:02:57 +0000 (12:02 -0400)]
zebra: GR data was being printed 2 times for `show zebra client`

When issuing the `show zebra client` command data about
Graceful Restart state is being printed 2 times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9735 from donaldsharp/watchfrr_netns
Igor Ryzhov [Thu, 7 Oct 2021 15:39:51 +0000 (18:39 +0300)]
Merge pull request #9735 from donaldsharp/watchfrr_netns

watchfrr: Allow an integrated config to work within a namespace

2 years agoMerge pull request #9740 from caracall/forked-upstream/debug_ospf6
Igor Ryzhov [Thu, 7 Oct 2021 15:38:22 +0000 (18:38 +0300)]
Merge pull request #9740 from caracall/forked-upstream/debug_ospf6

ospf6: add the ability of specifying router-id/area-id in no debug ospf6

2 years agobgpd: add missing vrf/view parameter to one command
Igor Ryzhov [Thu, 7 Oct 2021 15:29:22 +0000 (18:29 +0300)]
bgpd: add missing vrf/view parameter to one command

"show bgp neighbors PEER received prefix-filter" misses the argument.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agotools: Catch double pointer of struct thread towards thread_add_*
Donatas Abraitis [Thu, 7 Oct 2021 13:20:35 +0000 (16:20 +0300)]
tools: Catch double pointer of struct thread towards thread_add_*

```
% spatch --sp-file tools/coccinelle/struct_thread_double_pointer.cocci --macro-file tools/cocci.h ./ 2>/dev/null
./lib/northbound_confd.c:429:65-66: Passed double 'struct thread' pointer
./lib/northbound_confd.c:1174:61-62: Passed double 'struct thread' pointer
./lib/northbound_sysrepo.c:543:69-70: Passed double 'struct thread' pointer
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9345 from mjstapp/fix_lib_zmq_free
David Lamparter [Thu, 7 Oct 2021 13:20:19 +0000 (15:20 +0200)]
Merge pull request #9345 from mjstapp/fix_lib_zmq_free

2 years ago*: don't pass pointers to a local variables to thread_add_*
Igor Ryzhov [Thu, 7 Oct 2021 12:53:10 +0000 (15:53 +0300)]
*: don't pass pointers to a local variables to thread_add_*

We should never pass pointers to local variables to thread_add_* family.
When an event is executed, the library writes into this pointer, which
means it writes into some random memory on a stack.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9758 from idryzhov/resolver-thread
Donatas Abraitis [Thu, 7 Oct 2021 11:31:25 +0000 (14:31 +0300)]
Merge pull request #9758 from idryzhov/resolver-thread

lib: fix incorrect thread management

2 years agoMerge pull request #9698 from idryzhov/cleanup-loopback-or-vrf
Russ White [Wed, 6 Oct 2021 23:01:52 +0000 (19:01 -0400)]
Merge pull request #9698 from idryzhov/cleanup-loopback-or-vrf

*: cleanup interface loopback/vrf check

2 years agoMerge pull request #9699 from manojvn/379032-dev
Russ White [Wed, 6 Oct 2021 23:00:39 +0000 (19:00 -0400)]
Merge pull request #9699 from manojvn/379032-dev

ospf6d: minor struct compare issues.

2 years agoMerge pull request #9738 from rgirada/ospfv3_crash
Russ White [Wed, 6 Oct 2021 22:58:09 +0000 (18:58 -0400)]
Merge pull request #9738 from rgirada/ospfv3_crash

ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.

2 years agotests: clean up all_proto_startup a bit
Mark Stapp [Wed, 6 Oct 2021 17:49:52 +0000 (13:49 -0400)]
tests: clean up all_proto_startup a bit

Remove references to the deprecated "CLI()" function; clean up
a couple of string escapes; make one test-case sensitive to
previous failures.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoospfd: ospf nbr in full although mismatch in hello packet contents
Mobashshera Rasool [Wed, 6 Oct 2021 17:04:10 +0000 (10:04 -0700)]
ospfd: ospf nbr in full although mismatch in hello packet contents

Issue:
===================
OSPF neighbors are not going down even after 10 mins when
having a mismatch in hello and dead interval.
First neighbors are formed and then a mismatch in the interval
is created, it is observed that the neighbor is not going down.

Root Cause Analysis:
====================
The event HelloReceived defined in RFC 2328 was named as PacketReceived
and this event was scheduled whenever LS Update, LS Ack, LS Request,
DD description packet or Hello packet is received.
Although there is a mismatch in the Hello packet contents, the
event PacketReceived gets triggered due to LS Update received and the
dead timer gets reset and hence the neighbor was never going Down and
remains FULL.

Fix:
==================
As per RFC 2328, the HelloReceived needs to be triggered only when
valid OSPF Hello packet is received and not when other OSPF packets
are received. Modified the function name as well.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agowatchfrr: Allow an integrated config to work within a namespace
Donald Sharp [Tue, 5 Oct 2021 00:32:25 +0000 (20:32 -0400)]
watchfrr: Allow an integrated config to work within a namespace

Since watchfrr invokes vtysh to gather the show run output and
write the data, if we are operating inside of a namespace FRR
must also pass this in.

Yes. This seems hacky.  I don't fully understand why vtysh
is invoked this way.

New output:

sharpd@eva:~/frr3$ sudo vtysh -N one

Hello, this is FRRouting (version 8.1-dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

eva# wr mem
Note: this version of vtysh never writes vtysh.conf
% Can't open configuration file /etc/frr/one/vtysh.conf due to 'No such file or directory'.
Building Configuration...
Integrated configuration saved to /etc/frr/one/frr.conf
[OK]
eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobuild: bump configure.ac to `8.2-dev`
David Lamparter [Wed, 6 Oct 2021 16:18:17 +0000 (18:18 +0200)]
build: bump configure.ac to `8.2-dev`

[needs to happen ASAP to make sure we're not building confusing
packages.]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agodoc/developer: document dev tag on master
David Lamparter [Wed, 6 Oct 2021 16:12:26 +0000 (18:12 +0200)]
doc/developer: document dev tag on master

We have `frr-X.Y-dev` tags on master after pulling stable branches,
otherwise the `gitversion` tooling / `--with-pkg-git-version` gets
_very_ confused (it'll print something like:

```
FRRouting 8.2-dev-g210a75e65dad (areia).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
This is a git build of frr-8.1-rc1-8-g210a75e65dad
```

(Note the conflicting version numbers.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: fix incorrect thread management
Igor Ryzhov [Wed, 6 Oct 2021 14:35:07 +0000 (17:35 +0300)]
lib: fix incorrect thread management

The current code passes an address of a local variable to `thread_add_read`
which stores it into `thread->ref` by the lib. The next time the thread
callback is executed, the lib stores NULL into the `thread->ref` which
means it writes into some random memory on the stack.

To fix this, we should pass a pointer to the vector entry to the lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoospf6d: code cleanup.
Manoj Naragund [Thu, 30 Sep 2021 17:28:11 +0000 (10:28 -0700)]
ospf6d: code cleanup.

removal of some of the deadcode in ospf6d.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2 years agoMerge pull request #9755 from pguibert6WIND/isis_sr_doc
Renato Westphal [Wed, 6 Oct 2021 15:13:26 +0000 (12:13 -0300)]
Merge pull request #9755 from pguibert6WIND/isis_sr_doc

doc: fix show isis route prefix-sid command

2 years agotests: remove deprecated debug cli from some tests
Mark Stapp [Wed, 6 Oct 2021 14:51:04 +0000 (10:51 -0400)]
tests: remove deprecated debug cli from some tests

Some tests had commented-out references to the old "CLI()"
function. Remove those so they're not confusing in the future,
and replace at least one with a comment that uses the
'mininet_cli()' function.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoospf6: add the ability of specifying router-id/area-id in no debug ospf6
Ahmad Caracalli [Wed, 6 Oct 2021 13:46:19 +0000 (15:46 +0200)]
ospf6: add the ability of specifying router-id/area-id in no debug ospf6

Add the ability to specify the router-id/area-id when deleting the debug
ospf6 configuration.

The new commands are as follow:

no debug ospf6 border-routers router-id [A.B.C.D]
no debug ospf6 border-routers area-id [A.B.C.D]

Update the doc as well.

Signed-off-by: Ahmad Caracalli <ahmad.caracalli@6wind.com>
2 years agobgpd: Check return code for bgp_route_match_add
Donald Sharp [Wed, 6 Oct 2021 12:01:30 +0000 (08:01 -0400)]
bgpd: Check return code for bgp_route_match_add

FRR uses bgp_route_match_add and checked the return
code in every place but one.  Fix so that the
return code is looked at and warned against

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Check return from generic_set_add
Donald Sharp [Wed, 6 Oct 2021 11:58:35 +0000 (07:58 -0400)]
bgpd: Check return from generic_set_add

Coverity found a couple of spots where FRR was
ignoring the return code of generic_set_add.
Just follow the code pattern for the rest of
the usage in the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agodoc: fix show isis route prefix-sid command
Philippe Guibert [Wed, 6 Oct 2021 08:37:59 +0000 (10:37 +0200)]
doc: fix show isis route prefix-sid command

This command was not documented, and deprecates the old one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv
Donald Sharp [Wed, 6 Oct 2021 10:40:36 +0000 (06:40 -0400)]
Merge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv

topotests: improve bfd_ospf_topo1 test