]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agobgpd: don't use if_lookup_by_name_all_vrf
Igor Ryzhov [Thu, 14 Oct 2021 18:06:38 +0000 (21:06 +0300)]
bgpd: don't use if_lookup_by_name_all_vrf

if_lookup_by_name_all_vrf doesn't work correctly with netns VRF backend
as the same index may be used in multiple netns simultaneously.

Use the appropriate VRF when looking for the interface.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agobfdd: cleanup bfd_session_enable
Igor Ryzhov [Thu, 14 Oct 2021 18:06:38 +0000 (21:06 +0300)]
bfdd: cleanup bfd_session_enable

Well, there are some weird and duplicated checks there...

All we need is two simple checks:
- VRF existence. We must have it to enable the session.
- Interface existence. If it's configured for the session, we have to
  bind the session to the interface.

This commit implements these checks and removes unnecessary duplication.

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

2 years agoMerge pull request #9734 from donaldsharp/interface_startup
Renato Westphal [Wed, 6 Oct 2021 04:03:08 +0000 (01:03 -0300)]
Merge pull request #9734 from donaldsharp/interface_startup

Interface startup

2 years agoMerge pull request #9724 from idryzhov/isis-unused-func
Renato Westphal [Wed, 6 Oct 2021 03:58:47 +0000 (00:58 -0300)]
Merge pull request #9724 from idryzhov/isis-unused-func

isisd: remove unused function declaration

2 years agoZebra: Ignore the failure of startup intf lookup.
Yuan Yuan [Wed, 22 Sep 2021 20:02:40 +0000 (20:02 +0000)]
Zebra: Ignore the failure of startup intf lookup.

In startup, zebra would dump interface information from Kernel in 3
steps w/o lock: step1, get interface information; step2, get interface
ipv4 address; step3, get interface ipv6 address.
If any interface gets added after step1, but before step2/3, zebra
would get extra interface addresses in step2/3 that has not been added
into zebra in step1. Returning error in the referenced interface lookup
would cause the startup interface retrieval to be incomplete.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
2 years agoMerge pull request #9716 from rgirada/ospf_gr_nbr
Russ White [Tue, 5 Oct 2021 23:28:40 +0000 (19:28 -0400)]
Merge pull request #9716 from rgirada/ospf_gr_nbr

ospfd: GR helper functionality change in helper exit

2 years agoMerge pull request #9731 from ton31337/fix/thread_null_set
Russ White [Tue, 5 Oct 2021 23:27:23 +0000 (19:27 -0400)]
Merge pull request #9731 from ton31337/fix/thread_null_set

cleanup: struct thread = NULL

2 years agoMerge pull request #9728 from donaldsharp/null_thread
Russ White [Tue, 5 Oct 2021 23:26:00 +0000 (19:26 -0400)]
Merge pull request #9728 from donaldsharp/null_thread

Null thread

2 years agoMerge pull request #9733 from opensourcerouting/grpc-fix-missing
Russ White [Tue, 5 Oct 2021 23:24:34 +0000 (19:24 -0400)]
Merge pull request #9733 from opensourcerouting/grpc-fix-missing

lib: fix gRPC crash on missing YANG node

2 years agolib: fix spelling nits in more lib files
ewlumpkin [Tue, 5 Oct 2021 21:33:14 +0000 (21:33 +0000)]
lib: fix spelling nits in more lib files

Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2 years agoMerge pull request #9743 from pguibert6WIND/largecomm
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 19:30:45 +0000 (14:30 -0500)]
Merge pull request #9743 from pguibert6WIND/largecomm

bgpd: large community exact match fix

2 years agoMerge pull request #9711 from idryzhov/doc-ospf
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 19:25:42 +0000 (14:25 -0500)]
Merge pull request #9711 from idryzhov/doc-ospf

doc: fix ospf distribute-list command and description

2 years agoMerge pull request #9744 from idryzhov/isis-redist-cli
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 19:22:27 +0000 (14:22 -0500)]
Merge pull request #9744 from idryzhov/isis-redist-cli

isisd: fix redistribute CLI

2 years agoMerge pull request #9725 from idryzhov/doc-debug-ospf
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 16:52:32 +0000 (11:52 -0500)]
Merge pull request #9725 from idryzhov/doc-debug-ospf

doc: fix debugging-ospf label

2 years agoMerge pull request #9736 from ewlumpkin/comment_spelling_fixes
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 16:48:20 +0000 (11:48 -0500)]
Merge pull request #9736 from ewlumpkin/comment_spelling_fixes

lib: fix spelling nits in command.h

2 years agotopotests: justify code sleep
Rafael Zalamena [Tue, 5 Oct 2021 15:37:34 +0000 (12:37 -0300)]
topotests: justify code sleep

Document the `sleep` statement so people know that we are sleeping
because we are waiting for the BFD down notification. If we don't
sleep here it is possible that we get outdated `show` command results.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agotopotests: decrease result check frequency
Rafael Zalamena [Tue, 5 Oct 2021 15:36:43 +0000 (12:36 -0300)]
topotests: decrease result check frequency

Call the `show` commands less often to reduce the CPU pressure.

Also increase the wait time from 60 to 80 seconds to have spare room
for failures (4 times more). This is the latest measure wait time:

> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agotopotests: increase OSPF convergence speed
Rafael Zalamena [Tue, 5 Oct 2021 15:35:42 +0000 (12:35 -0300)]
topotests: increase OSPF convergence speed

Reduce timers so we send hello packets more often and reduce dead
interval to converge faster.

Previous test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 47.20 seconds

New test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agoisisd: fix redistribute CLI
Igor Ryzhov [Tue, 5 Oct 2021 14:38:21 +0000 (17:38 +0300)]
isisd: fix redistribute CLI

Currently, it is possible to configure IPv6 protocols for IPv4
redistribution and vice versa in CLI. The YANG model doesn't allow this
so the user receives the following error:
```
nfware(config-router)# redistribute ipv4 ospf6 level-1
% Failed to edit configuration.

YANG error(s):
 Invalid enumeration value "ospf6".
 Invalid enumeration value "ospf6".
 Invalid enumeration value "ospf6".
 YANG path: Schema location /frr-isisd:isis/instance/redistribute/ipv4/protocol.
```

Let's make CLI more user-friendly and allow only supported protocols in
redistribution commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>