]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 years agodoc: Update /doc/topotests.rst documentation 11707/head
Kuldeep Kashyap [Fri, 29 Jul 2022 04:54:29 +0000 (21:54 -0700)]
doc: Update /doc/topotests.rst documentation

Updated /doc/topotests.rst with socat details,
which is needed to run PIMv6 tests. Socat tool
is used to send PIMv6 join and traffic.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoMerge pull request #11702 from patrasar/pim_11675
Donald Sharp [Fri, 29 Jul 2022 11:05:50 +0000 (07:05 -0400)]
Merge pull request #11702 from patrasar/pim_11675

pimd: Update mroute IIF based on Nexthop received from Zebra

2 years agoMerge pull request #11703 from donaldsharp/blimey
mobash-rasool [Fri, 29 Jul 2022 04:53:17 +0000 (10:23 +0530)]
Merge pull request #11703 from donaldsharp/blimey

isisd: Prevent leak of global_ipv6_addrs

2 years agopimd: Update mroute IIF based on Nexthop received from Zebra 11702/head
Sarita Patra [Thu, 28 Jul 2022 17:40:52 +0000 (10:40 -0700)]
pimd: Update mroute IIF based on Nexthop received from Zebra

Topology:
R1(LHR) ---- R2 ----R4(FHR)
        ---- R3 ----

R2 = RP

Steps to reproduce:
1. R1(LHR) sends IGMP join, R4(FHR) sends multicast traffic.
   Verify traffic is flowing from FHR to LHR.
2. Restart R1(LHR).
3. Below sequence of events are happening after FRR restart in R1(LHR).
4. R1(LHR) Register RP address to Zebra.
5. R1(LHR) Receive update from Zebra that R2(RP) is reachable via R3.
6. R1(LHR) Receive IGMP join for group 225.1.1.1, will create pim upstream
   and (*,G) mroute with IIF towards R3.
7. R1(LHR) Receive update from Zebra that RP is reachable via R2(RP).
8. R1(LHR) Update the PIM upstream IIF, but not updating the (*,G) IIF
   even there is RPF change.
9. R1(LHR) receives IGMP join for group 225.1.1.2, will create (*,G) with
   IIF towards R2(RP), both upstream and (,G) created with IIF towards R2(RP).

Root Cause:
Mroute IIF is not getting updated when better route update
received. It is still pointing to the older nexthop.

Fix:
Update the mroute IIF when there is change in nexthop.

Fixing Issue #11675

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agoisisd: Prevent leak of global_ipv6_addrs 11703/head
Donald Sharp [Thu, 28 Jul 2022 16:21:24 +0000 (12:21 -0400)]
isisd: Prevent leak of global_ipv6_addrs

adj->global_ipv6_addrs was not being freed on deletion
of the adjacency.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11685 from sri-mohan1/sri-ospf
Jafar Al-Gharaibeh [Thu, 28 Jul 2022 16:59:53 +0000 (11:59 -0500)]
Merge pull request #11685 from sri-mohan1/sri-ospf

ospfclient: condition optimization

2 years agoMerge pull request #11695 from donaldsharp/afi_max
Donatas Abraitis [Thu, 28 Jul 2022 15:32:24 +0000 (18:32 +0300)]
Merge pull request #11695 from donaldsharp/afi_max

bgpd: Ensure we are not using AFI_MAX

2 years agoMerge pull request #11693 from opensourcerouting/fix/unlock_bgp_dest
Donald Sharp [Thu, 28 Jul 2022 15:30:11 +0000 (11:30 -0400)]
Merge pull request #11693 from opensourcerouting/fix/unlock_bgp_dest

bgpd: Unlock bgp_node after bgp_node_lookup

2 years agoMerge pull request #11697 from donaldsharp/bgp_work
mobash-rasool [Thu, 28 Jul 2022 11:37:06 +0000 (17:07 +0530)]
Merge pull request #11697 from donaldsharp/bgp_work

two things

2 years agobgpd: Unlock bgp_node after bgp_node_lookup 11693/head
Donatas Abraitis [Wed, 27 Jul 2022 11:51:15 +0000 (14:51 +0300)]
bgpd: Unlock bgp_node after bgp_node_lookup

bgp_node_lookup increments lock, we should decrement it after use.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11701 from kuldeepkash/pim_v6
Donatas Abraitis [Thu, 28 Jul 2022 11:33:04 +0000 (14:33 +0300)]
Merge pull request #11701 from kuldeepkash/pim_v6

tests: [PIMv6] Updated topology for static rp suite

2 years agotests: [PIMv6] Update topology for static rp suite 11701/head
Kuldeep Kashyap [Thu, 28 Jul 2022 02:51:43 +0000 (19:51 -0700)]
tests: [PIMv6] Update topology for static rp suite

Updated topology for static rp suite as per testcase.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoMerge pull request #11696 from sri-mohan1/sri-debug
Mark Stapp [Wed, 27 Jul 2022 19:17:23 +0000 (15:17 -0400)]
Merge pull request #11696 from sri-mohan1/sri-debug

ospf6d: corrected the debug string

2 years agoospf6d: corrected the debug string 11696/head
sri-mohan1 [Wed, 27 Jul 2022 16:51:06 +0000 (22:21 +0530)]
ospf6d: corrected the debug string

Corrected the gramatical error for debug string

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoospfd: Coverity warns that we could possibly use unininted data 11697/head
Donald Sharp [Wed, 27 Jul 2022 16:17:50 +0000 (12:17 -0400)]
ospfd: Coverity warns that we could possibly use unininted data

In ospf_handle_exnl_lsa_lsId_chg there is a code path
where that we may be using uninitialized data for decisions.
Doubtful that this happens but let's make it less likely to
even more.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Improve indentation in bgp_updgrp_adv.c
Donald Sharp [Wed, 27 Jul 2022 16:17:16 +0000 (12:17 -0400)]
bgpd: Improve indentation in bgp_updgrp_adv.c

This file was hard to read due to heavy indentation.
Let's fix it up some.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11682 from opensourcerouting/frr-format-gcc-12
Donald Sharp [Wed, 27 Jul 2022 15:44:39 +0000 (11:44 -0400)]
Merge pull request #11682 from opensourcerouting/frr-format-gcc-12

tools/gcc-plugins: make GCC 12 compatible

2 years agoMerge pull request #11689 from opensourcerouting/fix/port_for_unnumbered
Donald Sharp [Wed, 27 Jul 2022 15:42:09 +0000 (11:42 -0400)]
Merge pull request #11689 from opensourcerouting/fix/port_for_unnumbered

bgpd: Allow setting custom port for unnumbered sessions

2 years agobgpd: Ensure we are not using AFI_MAX 11695/head
Donald Sharp [Wed, 27 Jul 2022 13:36:17 +0000 (09:36 -0400)]
bgpd: Ensure we are not using AFI_MAX

When using bgp_vty_afi_from_str it can
return AFI_MAX( but in practice never will with
our cli ).  In bgp_default_afi_safi_cmd the code
directly references:
bgp->default_afi[afi][safi] = TRUE;

and if afi is AFI_MAX FRRR would be accessing
memory where it should not be.

Let's just provide some assurances for coverity
that this never happens.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfclient: condition optimization 11685/head
sri-mohan1 [Wed, 27 Jul 2022 06:44:46 +0000 (12:14 +0530)]
ospfclient: condition optimization

Its better to check the length and then the type of the LSA

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agobgpd: Reset BGP sessions when changing the port 11689/head
Donatas Abraitis [Wed, 27 Jul 2022 08:44:07 +0000 (11:44 +0300)]
bgpd: Reset BGP sessions when changing the port

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Allow setting custom port for BGP unnumbered peers
Donatas Abraitis [Wed, 27 Jul 2022 08:32:49 +0000 (11:32 +0300)]
bgpd: Allow setting custom port for BGP unnumbered peers

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11164 from kuldeepkash/pim_v6
Martin Winter [Wed, 27 Jul 2022 08:05:25 +0000 (10:05 +0200)]
Merge pull request #11164 from kuldeepkash/pim_v6

2 years agoMerge pull request #11681 from donaldsharp/valgrind_issues
Donatas Abraitis [Wed, 27 Jul 2022 07:51:25 +0000 (10:51 +0300)]
Merge pull request #11681 from donaldsharp/valgrind_issues

pimd: Fix a couple coverity issues with mtracebis_netlink.c

2 years agoMerge pull request #11678 from donaldsharp/valgrind_me
Donatas Abraitis [Wed, 27 Jul 2022 07:29:29 +0000 (10:29 +0300)]
Merge pull request #11678 from donaldsharp/valgrind_me

Valgrind me

2 years agotools/gcc-plugins: make GCC 12 compatible 11682/head
David Lamparter [Sun, 24 Jul 2022 18:52:24 +0000 (14:52 -0400)]
tools/gcc-plugins: make GCC 12 compatible

check_function_arguments_recurse() has received a new function argument
in GCC 12.  Fill it in and add a compatibility wrapper.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: Fix a couple coverity issues with mtracebis_netlink.c 11681/head
Donald Sharp [Tue, 26 Jul 2022 16:37:16 +0000 (12:37 -0400)]
pimd: Fix a couple coverity issues with mtracebis_netlink.c

Coverity is complaining that buf has not been initialized.
It has and coverity appears to be confused so let's help it
find the initialization.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11679 from donaldsharp/fix_compilation_bgp_vty
Christian Hopps [Tue, 26 Jul 2022 16:48:40 +0000 (12:48 -0400)]
Merge pull request #11679 from donaldsharp/fix_compilation_bgp_vty

bgpd: Remove newlines from zlog, they are not allowed

2 years agotests: Fixup more missing pytestmark annotations 11678/head
Donald Sharp [Tue, 26 Jul 2022 13:53:22 +0000 (09:53 -0400)]
tests: Fixup more missing pytestmark annotations

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Fix lost memory on lsp free
Donald Sharp [Tue, 26 Jul 2022 11:53:48 +0000 (07:53 -0400)]
zebra: Fix lost memory on lsp free

When cleaning up memory associated with a lsp the
nhlfe is lost in some cases.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Fixup pbr rule changes that were missed
Donald Sharp [Fri, 22 Jul 2022 18:49:06 +0000 (14:49 -0400)]
bgpd: Fixup pbr rule changes that were missed

In commit: d70a31a3ef2b60d978b336d5cc9ee5e1ec079dfc

the Zapi ZEBRA_RULE_ADD message was modified but
the bgp version was not updated appropriately and
when zebra received the message it did not properly
read it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Remove newlines from zlog, they are not allowed 11679/head
Donald Sharp [Tue, 26 Jul 2022 14:06:38 +0000 (10:06 -0400)]
bgpd: Remove newlines from zlog, they are not allowed

commit: a486300b2679ff80a13d800ed76e1236edfcaa2b
introduced newlines in zlog_XX messaging.  Not allowed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11582 from liwg06/master
Russ White [Tue, 26 Jul 2022 13:20:45 +0000 (09:20 -0400)]
Merge pull request #11582 from liwg06/master

bgpd: Fixup some MAC address token cli syntax

2 years agoMerge pull request #11523 from pguibert6WIND/bgp_no_retain
Russ White [Tue, 26 Jul 2022 12:50:59 +0000 (08:50 -0400)]
Merge pull request #11523 from pguibert6WIND/bgp_no_retain

Bgp no retain

2 years agoMerge pull request #11674 from opensourcerouting/fix/cleanup_subgrpoup_hash_on_update...
Donald Sharp [Mon, 25 Jul 2022 20:50:03 +0000 (16:50 -0400)]
Merge pull request #11674 from opensourcerouting/fix/cleanup_subgrpoup_hash_on_update_group_delete

bgpd: Cleanup subgroup hash when we delete/merge a subgroup

2 years agobgpd: Rename baa_new/baa_free/etc functions to be human-readable 11674/head
Donatas Abraitis [Mon, 25 Jul 2022 13:37:17 +0000 (16:37 +0300)]
bgpd: Rename baa_new/baa_free/etc functions to be human-readable

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Cleanup subgroup hash when we delete/merge a subgroup
Donatas Abraitis [Sat, 23 Jul 2022 17:47:27 +0000 (20:47 +0300)]
bgpd: Cleanup subgroup hash when we delete/merge a subgroup

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotests: [PIMv6] Add test_multicast_pimv6_static_rp suite 11164/head
Kuldeep Kashyap [Fri, 15 Jul 2022 08:01:23 +0000 (01:01 -0700)]
tests: [PIMv6] Add test_multicast_pimv6_static_rp suite

Adding supporting multicast PIMv6 static rp test
suite.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agotests: [PIMv6] APIs for multicast PIMv6 config
Kuldeep Kashyap [Sun, 8 May 2022 09:31:01 +0000 (02:31 -0700)]
tests: [PIMv6] APIs for multicast PIMv6 config

Enhanced few exsiting PIM APIs to support both
IPv4 and IPv6 configuration. Added few new APIs
for PIMv6. Tested all existing tests with new
API changes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoMerge pull request #11666 from opensourcerouting/fix/memory_leak_for_regexp_bgp_aspath
Donald Sharp [Sat, 23 Jul 2022 11:40:30 +0000 (07:40 -0400)]
Merge pull request #11666 from opensourcerouting/fix/memory_leak_for_regexp_bgp_aspath

bgpd: Free memory for as-path filter if regexp is wrong

2 years agoMerge pull request #11661 from donaldsharp/bnc_debugs
Donatas Abraitis [Sat, 23 Jul 2022 10:11:32 +0000 (13:11 +0300)]
Merge pull request #11661 from donaldsharp/bnc_debugs

bgpd: LL peers need bnc's per peer

2 years agoMerge pull request #11656 from donaldsharp/some_memory
Donatas Abraitis [Sat, 23 Jul 2022 10:10:59 +0000 (13:10 +0300)]
Merge pull request #11656 from donaldsharp/some_memory

Some memory

2 years agoMerge pull request #11669 from Chromico/master
Donatas Abraitis [Sat, 23 Jul 2022 10:10:43 +0000 (13:10 +0300)]
Merge pull request #11669 from Chromico/master

topotests: Drop static route

2 years agotopotests: Drop static route 11669/head
Chromico [Fri, 22 Jul 2022 21:42:28 +0000 (01:42 +0400)]
topotests: Drop static route

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
2 years agobgpd: Make sure hdr length is at a minimum of what is expected 11656/head
Donald Sharp [Thu, 21 Jul 2022 12:11:58 +0000 (08:11 -0400)]
bgpd: Make sure hdr length is at a minimum of what is expected

Ensure that if the capability length specified is enough data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11652 from pguibert6WIND/path_fini
Donald Sharp [Fri, 22 Jul 2022 17:22:37 +0000 (13:22 -0400)]
Merge pull request #11652 from pguibert6WIND/path_fini

pathd: add a zebra stop handler

2 years agoisisd: Ensure rcap is freed in error case
Donald Sharp [Wed, 20 Jul 2022 20:49:09 +0000 (16:49 -0400)]
isisd: Ensure rcap is freed in error case

unpack_tlv_router_cap allocates memory that in the error
case is not being freed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfclient: Ensure ospf_apiclient_lsa_originate cannot accidently write into stack
Donald Sharp [Wed, 20 Jul 2022 20:43:17 +0000 (16:43 -0400)]
ospfclient: Ensure ospf_apiclient_lsa_originate cannot accidently write into stack

Even though OSPF_MAX_LSA_SIZE is quite large and holds the upper bound
on what can be written into a lsa, let's add a small check to ensure
it is not possible to do a bad thing.

This wins one of the long standing bug awards.  2003!

Fixes: #11602
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Free memory for as-path filter if regexp is wrong 11666/head
Donatas Abraitis [Fri, 22 Jul 2022 14:38:54 +0000 (17:38 +0300)]
bgpd: Free memory for as-path filter if regexp is wrong

Before:

```
$ vtysh -c 'sh memory bgpd | include Temporary'; echo ; for x in $(seq 1 1000); do vtysh -c 'conf' -c 'bgp as-path access-list belekas permit wrong' >/dev/null; done; vtysh -c 'sh memory bgpd | include Temporary'
Temporary memory              :       19 variable       504       22       656
Temporary memory              :     1019 variable     24504     1023     24656
```

After:

```
$ vtysh -c 'sh memory bgpd | include Temporary'; echo ; for x in $(seq 1 1000); do vtysh -c 'conf' -c 'bgp as-path access-list belekas permit wrong' >/dev/null; done; vtysh -c 'sh memory bgpd | include Temporary'
Temporary memory              :       19 variable       504       22       656
Temporary memory              :       19 variable       504       24       680
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11565 from pguibert6WIND/bfd_vrf_lite_support
Rafael Zalamena [Fri, 22 Jul 2022 14:12:17 +0000 (14:12 +0000)]
Merge pull request #11565 from pguibert6WIND/bfd_vrf_lite_support

bfdd: allow l3vrf bfd sessions without udp leaking

2 years agoMerge pull request #11662 from opensourcerouting/fix/call_hooks_when_replacing_asfilter
Donald Sharp [Fri, 22 Jul 2022 13:48:25 +0000 (09:48 -0400)]
Merge pull request #11662 from opensourcerouting/fix/call_hooks_when_replacing_asfilter

bgpd: Call a hook when as-path filter is replaced

2 years agobgpd: LL peers need bnc's per peer 11661/head
Donald Sharp [Thu, 21 Jul 2022 19:42:51 +0000 (15:42 -0400)]
bgpd: LL peers need bnc's per peer

FRR should create a bnc per peer.  Not have
one's that write over others.  Currently when
FRR has multiple Interface based peering, BGP wa
creating a single BNC.  This is insufficient in that
we were accidently overwriting the one LL with other
data.  This causes issues when there are multiple and
there is weird starting issues with those interfaces
that you are peering over.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Call a hook when as-path filter is replaced 11662/head
Donatas Abraitis [Fri, 22 Jul 2022 11:16:02 +0000 (14:16 +0300)]
bgpd: Call a hook when as-path filter is replaced

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotopotests: add bfd_vrflite_topo1 test 11565/head
Philippe Guibert [Tue, 12 Jul 2022 10:12:01 +0000 (12:12 +0200)]
topotests: add bfd_vrflite_topo1 test

This tests checks that there are no errors when receiving BFD
packets over the various linux vrf interfaces. For example, if
an incoming packet is received by the wrong socket, a VRF
mismatch error would occur, and BFD flapping would be observed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agopathd: add a zebra stop handler 11652/head
Philippe Guibert [Wed, 20 Jul 2022 12:53:20 +0000 (14:53 +0200)]
pathd: add a zebra stop handler

This handler code is used to stop zebra related contexts.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #11658 from Jafaral/up-rel8.3
Donatas Abraitis [Fri, 22 Jul 2022 05:26:23 +0000 (08:26 +0300)]
Merge pull request #11658 from Jafaral/up-rel8.3

debian, redhat: updating changelog for new release

2 years agoMerge pull request #11657 from donaldsharp/why_timer
Donatas Abraitis [Fri, 22 Jul 2022 05:26:08 +0000 (08:26 +0300)]
Merge pull request #11657 from donaldsharp/why_timer

convert thread_cancel to THREAD_OFF

2 years agodebian, redhat: updating changelog for new release 11658/head
Jafar Al-Gharaibeh [Sun, 17 Jul 2022 04:27:20 +0000 (23:27 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #11654 from donaldsharp/fixup_macros
mobash-rasool [Thu, 21 Jul 2022 13:40:41 +0000 (19:10 +0530)]
Merge pull request #11654 from donaldsharp/fixup_macros

*: frr_with_mutex change to follow our standard

2 years agoldpd: Convert thread_cancel to THREAD_OFF 11657/head
Donald Sharp [Thu, 21 Jul 2022 12:26:43 +0000 (08:26 -0400)]
ldpd: Convert thread_cancel to THREAD_OFF

Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoisisd: Convert thread_cancel to THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 17:49:45 +0000 (13:49 -0400)]
isisd: Convert thread_cancel to THREAD_OFF

Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Convert thread_cancel to THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 16:47:04 +0000 (12:47 -0400)]
zebra: Convert thread_cancel to THREAD_OFF

Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib, vrrpd: Use THREAD_ARG
Donald Sharp [Fri, 3 Jun 2022 15:38:15 +0000 (11:38 -0400)]
lib, vrrpd: Use THREAD_ARG

Don't auto set the thread->arg pointer.  It is private
and should be only accessed through the THREAD_ARG pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Convert thread_cancel to THREAD_OFF and use THREAD_ARG
Donald Sharp [Fri, 3 Jun 2022 14:59:31 +0000 (10:59 -0400)]
bgpd: Convert thread_cancel to THREAD_OFF and use THREAD_ARG

Just convert all uses of thread_cancel to THREAD_OFF.  Additionally
use THREAD_ARG instead of t->arg to get the arguement.  Individual
files should never be accessing thread private data like this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Remove various macros that overlap THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:43:45 +0000 (10:43 -0400)]
bgpd: Remove various macros that overlap THREAD_OFF

Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripngd: Convert thread_cancel to THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:38:59 +0000 (10:38 -0400)]
ripngd: Convert thread_cancel to THREAD_OFF

Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripngd: Remove various macros that overlap THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:37:34 +0000 (10:37 -0400)]
ripngd: Remove various macros that overlap THREAD_OFF

Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripd: Convert thread_cancel to THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:34:47 +0000 (10:34 -0400)]
ripd: Convert thread_cancel to THREAD_OFF

Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripd: Remove various macros that overlap THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:33:12 +0000 (10:33 -0400)]
ripd: Remove various macros that overlap THREAD_OFF

Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: Convert thread_cancel to THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:31:04 +0000 (10:31 -0400)]
ospfd: Convert thread_cancel to THREAD_OFF

Just convert all uses of thread_cancel to THREAD_OFF.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: Remove various macros that overlap THREAD_OFF
Donald Sharp [Fri, 3 Jun 2022 14:28:11 +0000 (10:28 -0400)]
ospfd: Remove various macros that overlap THREAD_OFF

Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11653 from louis-6wind/fix-isis-sr-php
Donald Sharp [Thu, 21 Jul 2022 12:04:18 +0000 (08:04 -0400)]
Merge pull request #11653 from louis-6wind/fix-isis-sr-php

isisd: fix prefix-sid last-hop-behavior

2 years agoMerge pull request #11655 from opensourcerouting/fix/vtysh_end_parsing
Donald Sharp [Thu, 21 Jul 2022 12:02:30 +0000 (08:02 -0400)]
Merge pull request #11655 from opensourcerouting/fix/vtysh_end_parsing

vtysh: Ignore `end` when parsing frr.conf

2 years agovtysh: Ignore `end` when parsing frr.conf 11655/head
Donatas Abraitis [Wed, 20 Jul 2022 19:57:33 +0000 (22:57 +0300)]
vtysh: Ignore `end` when parsing frr.conf

If we have `end` at the end of the frr.conf, then we never execute
XFRR_end_configuration command, and start/end markers do not work.

This leads to for example waiting BGP configuration parsing thread to hang,
and the peers are in shutdown state until the timer expires.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years ago*: frr_with_mutex change to follow our standard 11654/head
Donald Sharp [Wed, 20 Jul 2022 19:47:42 +0000 (15:47 -0400)]
*: frr_with_mutex change to follow our standard

convert:
frr_with_mutex(..)

to:
frr_with_mutex (..)

To make all our code agree with what clang-format is going to produce

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoisisd: fix prefix-sid last-hop-behavior 11653/head
Louis Scalbert [Wed, 20 Jul 2022 17:25:52 +0000 (19:25 +0200)]
isisd: fix prefix-sid last-hop-behavior

The php value is defined in yang but not properly set.

Fixes: 8f6c893629 ("isisd: add segment-routing CLI commands")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoMerge pull request #11651 from anlancs/fix/minor-7
mobash-rasool [Wed, 20 Jul 2022 16:18:35 +0000 (21:48 +0530)]
Merge pull request #11651 from anlancs/fix/minor-7

ospfd: correct one debug info for lsa

2 years agoMerge pull request #11643 from ARShreenidhi/df_or_ntw_auto
Donatas Abraitis [Wed, 20 Jul 2022 08:43:10 +0000 (11:43 +0300)]
Merge pull request #11643 from ARShreenidhi/df_or_ntw_auto

tests: bgp default orignate behaviour on network commands

2 years agoMerge pull request #11648 from donaldsharp/snmp_testing
Donatas Abraitis [Wed, 20 Jul 2022 07:08:20 +0000 (10:08 +0300)]
Merge pull request #11648 from donaldsharp/snmp_testing

Bunch of stuff found during testing.

2 years agoMerge pull request #11638 from alirezaarzehgar/docfix_typo
Donatas Abraitis [Wed, 20 Jul 2022 06:56:30 +0000 (09:56 +0300)]
Merge pull request #11638 from alirezaarzehgar/docfix_typo

doc: Remove extra "in" from document

2 years agoospfd: correct one debug info for lsa 11651/head
anlan_cs [Wed, 20 Jul 2022 04:09:54 +0000 (00:09 -0400)]
ospfd: correct one debug info for lsa

The index about slots should be displayed as `slot`. Additionally, adjust format.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11649 from rampxxxx/bfd_cleanup_warning
Donald Sharp [Wed, 20 Jul 2022 00:25:26 +0000 (20:25 -0400)]
Merge pull request #11649 from rampxxxx/bfd_cleanup_warning

BFDD: Cleanup warning

2 years agobfdd: allow l3vrf bfd sessions without udp leaking
Philippe Guibert [Thu, 7 Jul 2022 12:33:48 +0000 (14:33 +0200)]
bfdd: allow l3vrf bfd sessions without udp leaking

Until now, when in vrf-lite mode, the BFD implementation
creates a single UDP socket and relies on the following
sysctl value to 1:

echo 1 > /proc/sys/net/ipv4/udp_l3mdev_accept

With this setting, the incoming BFD packets from a given
vrf, would leak to the default vrf, and would match the
UDP socket.

The drawback of this solution is that udp packets received
on a given vrf may leak to an other vrf. This may be a
security concern.

The commit addresses this issue by avoiding this leak
mechanism. An UDP socket is created for each vrf, and each
socket uses new setsockopt option: SO_REUSEADDR + SO_REUSEPORT.

With this option, the incoming UDP packets are distributed on
the available sockets. The impact of those options with l3mdev
devices is unknown. It has been observed that this option is not
needed, until the default vrf sockets are created.

To ensure the BFD packets are correctly routed to the appropriate
socket, a BPF filter has been put in place and attached to the
sockets : SO_ATTACH_REUSEPORT_CBPF. This option adds a criterium
to force the packet to choose a given socket. If initial criteria
from the default distribution algorithm were not good, at least
two sockets would be available, and the CBPF would force the
selection to the same socket. This would come to the situation
where an incoming packet would be processed on a different vrf.

The bpf code is the following one:

struct sock_filter code[] = {
 { BPF_RET | BPF_K, 0, 0, 0 },
};

struct sock_fprog p = {
          .len = sizeof(code)/sizeof(struct sock_filter),
          .filter = code,
};

if (setsockopt(sd, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, &p, sizeof(p))) {
        zlog_warn("unable to set SO_ATTACH_REUSEPORT_CBPF on socket: %s",
                  strerror(errno));
        return -1;
}

Some tests have been done with by creating vrf contexts, and by using
the below vtysh configuration:

ip route 2.2.2.2/32 10.126.0.2
vrf vrf2
 ip route 2.2.2.2/32 10.126.0.2
!
interface ntfp2
 ip address 10.126.0.1/24
!
interface ntfp3 vrf vrf4
 ip address 10.126.0.1/24
!
interface ntfp2 vrf vrf1
 ip address 10.126.0.1/24
!
interface ntfp2.100 vrf vrf2
 ip address 10.126.0.1/24
!
interface ntfp2.200 vrf vrf3
 ip address 10.126.0.1/24
!
line vty
!
bfd
 peer 10.126.0.2 vrf vrf2
 !
 peer 10.126.0.2 vrf vrf3
 !
 peer 10.126.0.2
 !
 peer 10.126.0.2 vrf vrf4
 !
 peer 2.2.2.2 multihop local-address 1.1.1.1
 !
 peer 2.2.2.2 multihop local-address 1.1.1.1 vrf vrf2
  transmit-interval 1500
  receive-interval 1500
 !

The results showed no issue related to packets received by
the wrong vrf. Even changing the udp_l3mdev_accept flag to
1 did not change the test results.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoBFDD: Cleanup warning 11649/head
lynnemorrison [Tue, 19 Jul 2022 19:23:50 +0000 (15:23 -0400)]
BFDD: Cleanup warning

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
2 years agoMerge pull request #11644 from AbhishekNR/clear_cmd_interface
Donald Sharp [Tue, 19 Jul 2022 18:16:41 +0000 (14:16 -0400)]
Merge pull request #11644 from AbhishekNR/clear_cmd_interface

pim6d: Implementing "clear ipv6 pim interfaces" command.

2 years agoMerge pull request #11646 from opensourcerouting/fix/memory_show
Donald Sharp [Tue, 19 Jul 2022 18:13:17 +0000 (14:13 -0400)]
Merge pull request #11646 from opensourcerouting/fix/memory_show

bgpd: Show extended communities memory consumption

2 years agozebra: Add some more data to rtadv socket failures 11648/head
Donald Sharp [Tue, 19 Jul 2022 17:57:56 +0000 (13:57 -0400)]
zebra: Add some more data to rtadv socket failures

The creation of the rtadv socket can fail but there
is very very little data associated with this event
to let the operator know something has gone terribly
wrong.

Please note if this socket fails to create or fails
the setsockopt's rtadv is basically just really really
messed up.  I am not sure what can be done here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: rfapi code does not need to assert on memory allocations
Donald Sharp [Sat, 9 Jul 2022 00:53:43 +0000 (20:53 -0400)]
bgpd: rfapi code does not need to assert on memory allocations

cleanup memory allocations asserting that it didn't fail
as well as clean up some thread shenanigans.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Prevent memory leak of listener on shutdown
Donald Sharp [Sat, 9 Jul 2022 00:39:28 +0000 (20:39 -0400)]
bgpd: Prevent memory leak of listener on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: thread pointer is already null at this point
Donald Sharp [Fri, 8 Jul 2022 20:14:13 +0000 (16:14 -0400)]
lib: thread pointer is already null at this point

in agentx_events_update the timeout_thr is canceled
on line 88 just above.  This already sets the pointer
to NULL.  No need to do this again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Make bgp_snmp_mplsl3vpn be more forgiving
Donald Sharp [Fri, 8 Jul 2022 20:35:51 +0000 (16:35 -0400)]
tests: Make bgp_snmp_mplsl3vpn be more forgiving

I rarely get this failure:
@classname: bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn
@name: test_pe1_converge_evpn
@time: 44.875
@message: AssertionError: BGP SNMP does not seem to be running
assert False
 +  where False = <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>>('bgpVersion', '10')
 +    where <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>> = <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>.test_oid
        "Wait for protocol convergence"
        tgen = get_topogen()

        r1 = tgen.gears["r1"]
        r1_snmp = SnmpTester(r1, "10.1.1.1", "public", "2c")

        assertmsg = "BGP SNMP does not seem to be running"
>       assert r1_snmp.test_oid("bgpVersion", "10"), assertmsg
E       AssertionError: BGP SNMP does not seem to be running
E       assert False
E        +  where False = <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>>('bgpVersion', '10')
E        +    where <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>> = <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>.test_oid

Under heavy system load a quick test before BGP can fully come up can result in a failed
test.  Add some extra time for snmp to come up properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agodoc: Remove extra "in" from document 11638/head
alireza [Mon, 18 Jul 2022 15:02:17 +0000 (19:32 +0430)]
doc: Remove extra "in" from document

On line 16 of this file following sentence has a typo.
> * once done, the updated copy is swapped in in a single

Remove unused "in" from document.

Signed-off-by: alireza <alirezaarzehgar82@gmail.com>
2 years agobgpd: Fixup some MAC address token cli syntax 11582/head
Weiguo Li [Tue, 19 Jul 2022 14:31:57 +0000 (22:31 +0800)]
bgpd: Fixup some MAC address token cli syntax

MAC address token YY:YY:YY:YY:YY:YY is deprecated, use X:X:X:X:X:X instead.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
2 years agoMerge pull request #11637 from opensourcerouting/fix/remaining_sec_for_null
Donald Sharp [Tue, 19 Jul 2022 16:07:02 +0000 (12:07 -0400)]
Merge pull request #11637 from opensourcerouting/fix/remaining_sec_for_null

*: thread_timer_remain_second NULL handling

2 years agoMerge pull request #11613 from anlancs/fix/minor-6
Russ White [Tue, 19 Jul 2022 15:16:54 +0000 (11:16 -0400)]
Merge pull request #11613 from anlancs/fix/minor-6

zebra: correctly display one debug flag about ES Peer

2 years agotests: bgp default orignate behaviour on network commands 11643/head
ARShreenidhi [Tue, 19 Jul 2022 04:40:45 +0000 (04:40 +0000)]
tests: bgp default orignate behaviour on network commands

test script covers
1. Default originate behaviour using  'network <x.x.x.x>' command
2. Default originate behaviour using aggregate summary command

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2 years agopim6d: Implementing "clear ipv6 pim interfaces" command. 11644/head
Abhishek N R [Tue, 19 Jul 2022 06:44:47 +0000 (23:44 -0700)]
pim6d: Implementing "clear ipv6 pim interfaces" command.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agoMerge pull request #11611 from fdumontet6WIND/FMJA/desc_mess
Russ White [Tue, 19 Jul 2022 12:38:53 +0000 (08:38 -0400)]
Merge pull request #11611 from fdumontet6WIND/FMJA/desc_mess

bgp:change in showing neighbor description

2 years agobgpd: Show extended communities memory consumption 11646/head
Donatas Abraitis [Tue, 19 Jul 2022 11:02:41 +0000 (14:02 +0300)]
bgpd: Show extended communities memory consumption

Just fix the description because it's wrong.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11632 from opensourcerouting/fix/address_family_bgp_str
Donald Sharp [Mon, 18 Jul 2022 18:26:42 +0000 (14:26 -0400)]
Merge pull request #11632 from opensourcerouting/fix/address_family_bgp_str

bgpd: Add constants for some repetitive CLI strings