]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agolib: optimize if_lookup_by_name_all_vrf
Igor Ryzhov [Wed, 13 Oct 2021 20:23:41 +0000 (23:23 +0300)]
lib: optimize if_lookup_by_name_all_vrf

We already have a VRF pointer, no need to search for it again.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.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 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 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 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 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 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 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 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 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 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>
2 years agobgpd: large community exact match fix
Philippe Guibert [Tue, 5 Oct 2021 14:24:41 +0000 (16:24 +0200)]
bgpd: large community exact match fix

The pointer to large community was not the appropriate one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agolib: prevent gRPC assert on missing YANG node
Rafael Zalamena [Mon, 4 Oct 2021 21:10:58 +0000 (18:10 -0300)]
lib: prevent gRPC assert on missing YANG node

`yang_dnode_get` will `assert` if no YANG node/model exist, so lets test for
its existence first before trying to access it.

This `assert` is only acceptable for internal FRR usage otherwise we
might miss typos or unmatching YANG models nodes/leaves. For gRPC usage
we should let users attempt to use non existing models without
`assert`ing.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agoospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.
rgirada [Tue, 5 Oct 2021 07:52:36 +0000 (00:52 -0700)]
ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.

Description:
When grace lsa received, DUT is adding
the copy of the  lsas  to all nbrs retransmission  list as part of
flooding procedure and subsequently incrementing the rmt counter in
the original the LSA. This counter is supposed to be decremented
when ack is received by nbr and the lsa  will be removed from retransmission list.

But in our current scenario,
Step-1:
When GR helper is disabled, if DUT receives the grace lsa
it adds the lsa copy to nbrs retransmission list but original
LSA will be discarded since GR helper disabled.
Step-2:
GR helper enabled and DUT receives the grace lsa, as part
of flooding process all nbrs have same copy of lsa in their
corresponding rmt list which was added in step -1 due to this
the corresponding rmt counter in the original lsa is not getting
incremented.
Step-3:
If the same copy of the grace lsa received by DUT, It considers
as implicit ack from nbr if the same copy of the lsa exits in its
rmt list and subsequently  decrement the rmt counter.
Since counter is zero (because of step-1 and 2) , it is asserting while decrement.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2 years agoyang: replace an empty pattern with a zero-length restriction
Igor Ryzhov [Tue, 5 Oct 2021 10:27:39 +0000 (13:27 +0300)]
yang: replace an empty pattern with a zero-length restriction

No functional difference, but `length "0"` is more comprehensible.

Suggested-by: Christian Hopps <chopps@labn.net>
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agolib: fix spelling nits in command.h
ewlumpkin [Tue, 5 Oct 2021 03:05:42 +0000 (03:05 +0000)]
lib: fix spelling nits in command.h

Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2 years agozebra: Use a bool for startup indications
Donald Sharp [Tue, 5 Oct 2021 00:26:38 +0000 (20:26 -0400)]
zebra: Use a bool for startup indications

Let's not pass around an int startup when all we are doing
is true/falsing it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9726 from donaldsharp/ospf6_expire
Renato Westphal [Tue, 5 Oct 2021 00:13:50 +0000 (21:13 -0300)]
Merge pull request #9726 from donaldsharp/ospf6_expire

ospf6d: Ensure expire thread is properly stopped

2 years agozebra: On interface startup note that we are in startup
Donald Sharp [Mon, 4 Oct 2021 20:00:27 +0000 (16:00 -0400)]
zebra: On interface startup note that we are in startup

The boolean to notice that we are in startup situations
was not being properly set in one spot.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9722 from chiragshah6/zdev
Sri Mohana Singamsetty [Mon, 4 Oct 2021 17:07:00 +0000 (10:07 -0700)]
Merge pull request #9722 from chiragshah6/zdev

zebra: add nhg id to show ip route json

2 years agotools: Add coccinelle script to catch thread to NULL assignments
Donatas Abraitis [Mon, 4 Oct 2021 16:27:27 +0000 (19:27 +0300)]
tools: Add coccinelle script to catch thread to NULL assignments

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agowatchfrr: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:55 +0000 (19:26 +0300)]
watchfrr: 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 [Mon, 4 Oct 2021 16:26:39 +0000 (19:26 +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 agopimd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:20 +0000 (19:26 +0300)]
pimd: 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 agoospf6d: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:01 +0000 (19:26 +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 agonhrpd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:25:43 +0000 (19:25 +0300)]
nhrpd: 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 agoldpd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:25:18 +0000 (19:25 +0300)]
ldpd: 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 [Mon, 4 Oct 2021 16:24:54 +0000 (19:24 +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 agobfdd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:24:28 +0000 (19:24 +0300)]
bfdd: 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 agozebra: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:23:55 +0000 (19:23 +0300)]
zebra: 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 agoospf6d: Ensure expire thread is properly stopped
Donald Sharp [Mon, 4 Oct 2021 12:37:16 +0000 (08:37 -0400)]
ospf6d: Ensure expire thread is properly stopped

The lsa->expire thread is for keeping track of when we
are expecting to expire(remove/delete) a lsa.  There
are situations where we just decide to straight up
delete the lsa, but we are not ensuring that the
lsa is not already setup for expiration.
In that case just stop the expiry thread and
do the deletion.

Additionally there was a case where ospf6d was
just dropping the fact that a thread was already
scheduled for expiration.  In that case we
should just setup the timer again and it will
reset it appropriately.

Fixes: #9721
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Don't set NULL for struct thread at bgp_dump_interval_func()
Donatas Abraitis [Mon, 4 Oct 2021 14:49:06 +0000 (17:49 +0300)]
bgpd: Don't set NULL for struct thread at bgp_dump_interval_func()

NULL is already handled by thread_fetch().

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9689 from AnuradhaKaruppiah/bgp-evpn-lttng
Donatas Abraitis [Mon, 4 Oct 2021 16:05:41 +0000 (19:05 +0300)]
Merge pull request #9689 from AnuradhaKaruppiah/bgp-evpn-lttng

bgpd: initial batch of evpn lttng tracepoints

2 years agoeigrpd: Ensure better `struct thread *` semantics
Donald Sharp [Mon, 4 Oct 2021 13:47:29 +0000 (09:47 -0400)]
eigrpd: Ensure better `struct thread *` semantics

1) 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.

2) Fix mixup of `struct eigrp_interface` and `struct eigrp`
usage of the same thread pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripd: Ensure better `struct thread *` semantics
Donald Sharp [Mon, 4 Oct 2021 13:36:27 +0000 (09:36 -0400)]
ripd: Ensure better `struct thread *` semantics

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: Donald Sharp <sharpd@nvidia.com>
2 years agoripngd: Ensure better `struct thread *` semantics
Donald Sharp [Mon, 4 Oct 2021 13:28:36 +0000 (09:28 -0400)]
ripngd: Ensure better `struct thread *` semantics

1) Remove `struct thread *` pointers that are never used
2) 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: Donald Sharp <sharpd@nvidia.com>
2 years agoisisd: remove unused function declaration
Igor Ryzhov [Mon, 4 Oct 2021 12:23:46 +0000 (15:23 +0300)]
isisd: remove unused function declaration

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agodoc: fix debugging-ospf label
Igor Ryzhov [Mon, 4 Oct 2021 12:22:24 +0000 (15:22 +0300)]
doc: fix debugging-ospf label

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