]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
22 months 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

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

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

22 months agobgpd: Rename baa_new/baa_free/etc functions to be human-readable
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>
22 months 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>
22 months 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

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

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

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

22 months agotopotests: Drop static route
Chromico [Fri, 22 Jul 2022 21:42:28 +0000 (01:42 +0400)]
topotests: Drop static route

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
22 months agobgpd: Make sure hdr length is at a minimum of what is expected
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>
22 months 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

22 months 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>
22 months 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>
22 months agobgpd: Free memory for as-path filter if regexp is wrong
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>
22 months 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

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

22 months agobgpd: LL peers need bnc's per peer
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>
22 months agobgpd: Call a hook when as-path filter is replaced
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>
22 months agotopotests: add bfd_vrflite_topo1 test
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>
22 months agopathd: add a zebra stop handler
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>
22 months 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

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

22 months agodebian, redhat: updating changelog for new release
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>
22 months 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

22 months agoldpd: Convert thread_cancel to THREAD_OFF
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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months 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

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

22 months agovtysh: Ignore `end` when parsing frr.conf
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>
22 months ago*: frr_with_mutex change to follow our standard
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>
22 months agoisisd: fix prefix-sid last-hop-behavior
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>
22 months 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

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

22 months 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.

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

22 months agoospfd: correct one debug info for lsa
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>
22 months 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

22 months 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>
22 months agoBFDD: Cleanup warning
lynnemorrison [Tue, 19 Jul 2022 19:23:50 +0000 (15:23 -0400)]
BFDD: Cleanup warning

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
22 months 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.

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

22 months agozebra: Add some more data to rtadv socket failures
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>
22 months 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>
22 months 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>
22 months 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>
22 months 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>
22 months agodoc: Remove extra "in" from document
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>
22 months agobgpd: Fixup some MAC address token cli syntax
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>
22 months 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

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

22 months agotests: bgp default orignate behaviour on network commands
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>
22 months agopim6d: Implementing "clear ipv6 pim interfaces" command.
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>
22 months 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

22 months agobgpd: Show extended communities memory consumption
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>
22 months 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

22 months agoMerge pull request #11633 from mobash-rasool/fixes3
Donatas Abraitis [Mon, 18 Jul 2022 18:20:27 +0000 (21:20 +0300)]
Merge pull request #11633 from mobash-rasool/fixes3

pim6d: clear interface stats on interface shutdown

22 months agoMerge pull request #11635 from opensourcerouting/fix/memory_leak_for_mpls
Jafar Al-Gharaibeh [Mon, 18 Jul 2022 17:42:36 +0000 (12:42 -0500)]
Merge pull request #11635 from opensourcerouting/fix/memory_leak_for_mpls

zebra: Cleanup the memory from the hash for MPLS stuff

22 months agobgpd, ldpd: No need for an explicit NULL check for thread_timer_remain_second
Donatas Abraitis [Mon, 18 Jul 2022 13:42:23 +0000 (16:42 +0300)]
bgpd, ldpd: No need for an explicit NULL check for thread_timer_remain_second

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agolib: Return 0 as remaining msec if the thread is not scheduled
Donatas Abraitis [Mon, 18 Jul 2022 13:28:30 +0000 (16:28 +0300)]
lib: Return 0 as remaining msec if the thread is not scheduled

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #11626 from opensourcerouting/fix/avoid_buffer_overflow
Donald Sharp [Mon, 18 Jul 2022 13:20:11 +0000 (09:20 -0400)]
Merge pull request #11626 from opensourcerouting/fix/avoid_buffer_overflow

zebra: Avoid buffer overflow using netlink_parse_rtattr_nested()

22 months agoMerge pull request #11631 from opensourcerouting/fix/crash_for_checking_thread_remaining
Donald Sharp [Mon, 18 Jul 2022 13:19:50 +0000 (09:19 -0400)]
Merge pull request #11631 from opensourcerouting/fix/crash_for_checking_thread_remaining

ldpd: Check if the thread is scheduled before calling for remained time

22 months agobgp:change in showing neighbor description
Francois Dumontet [Tue, 12 Jul 2022 12:12:08 +0000 (14:12 +0200)]
bgp:change in showing neighbor description

currently "show bgp summary" and "sho bgp summary wide" commands
provide a description string until a whitespace is occuring this
respectively with size limits of 20 and 60 chars

now theses two commands are providing strings with all
characters until the last witespace before size limit

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
22 months agozebra: Cleanup the memory from the hash for MPLS stuff
Donatas Abraitis [Mon, 18 Jul 2022 11:26:29 +0000 (14:26 +0300)]
zebra: Cleanup the memory from the hash for MPLS stuff

==1595641== 280 (80 direct, 200 indirect) bytes in 1 blocks are definitely lost in loss record 30 of 38
==1595641== at 0x483AB65: calloc (vg_replace_malloc.c:760)
==1595641== by 0x493C89C: qcalloc (memory.c:116)
==1595641== by 0x1E8426: lsp_alloc (zebra_mpls.c:1116)
==1595641== by 0x49147F1: hash_get (hash.c:162)
==1595641== by 0x1EC880: mpls_lsp_install (zebra_mpls.c:3192)
==1595641== by 0x1C51BB: zread_vrf_label (zapi_msg.c:3197)
==1595641== by 0x1C6F11: zserv_handle_commands (zapi_msg.c:3863)
==1595641== by 0x24D0F4: zserv_process_messages (zserv.c:523)
==1595641== by 0x498F4CC: thread_call (thread.c:2002)
==1595641== by 0x49253A2: frr_run (libfrr.c:1198)
==1595641== by 0x1A28BA: main (main.c:475)
==1595641==
==1595641== 1,400 (400 direct, 1,000 indirect) bytes in 5 blocks are definitely lost in loss record 35 of 38
==1595641== at 0x483AB65: calloc (vg_replace_malloc.c:760)
==1595641== by 0x493C89C: qcalloc (memory.c:116)
==1595641== by 0x1E8426: lsp_alloc (zebra_mpls.c:1116)
==1595641== by 0x49147F1: hash_get (hash.c:162)
==1595641== by 0x1EBD7C: mpls_zapi_labels_process (zebra_mpls.c:2915)
==1595641== by 0x1C35D9: zread_mpls_labels_add (zapi_msg.c:2513)
==1595641== by 0x1C6F11: zserv_handle_commands (zapi_msg.c:3863)
==1595641== by 0x24D0F4: zserv_process_messages (zserv.c:523)
==1595641== by 0x498F4CC: thread_call (thread.c:2002)
==1595641== by 0x49253A2: frr_run (libfrr.c:1198)
==1595641== by 0x1A28BA: main (main.c:475)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #11627 from qlyoung/update-alpine-build
Donatas Abraitis [Mon, 18 Jul 2022 08:50:35 +0000 (11:50 +0300)]
Merge pull request #11627 from qlyoung/update-alpine-build

Update Alpine packaging foo + change docker images back over to Alpine-provided libyang

22 months agoMerge pull request #11629 from mobash-rasool/fixes2
Donatas Abraitis [Mon, 18 Jul 2022 08:43:49 +0000 (11:43 +0300)]
Merge pull request #11629 from mobash-rasool/fixes2

pimd: Remove the api from .h file since there is no definition of it

22 months agopim6d: clear interface stats on interface shutdown
Mobashshera Rasool [Mon, 18 Jul 2022 08:18:16 +0000 (01:18 -0700)]
pim6d: clear interface stats on interface shutdown

The clear was happening only for PIMv4. Removed the PIMv4
check.

Fixes: #11628
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
22 months agobgpd: Add constants for some repetitive CLI strings
Donatas Abraitis [Mon, 18 Jul 2022 07:05:35 +0000 (10:05 +0300)]
bgpd: Add constants for some repetitive CLI strings

"Address Family\n"
"Address Family modifier\n"

Before:

```
donatas-laptop(config-router)# address-family ipv4
  <cr>
  flowspec         Address Family Modifier
  labeled-unicast  Address Family modifier
  multicast        Address Family modifier
  unicast          Address Family Modifier
  vpn              Address Family modifier
```

After:

```
donatas-laptop(config-router)# address-family
  ipv4   Address Family
  ipv6   Address Family
  l2vpn  Address Family
donatas-laptop(config-router)# address-family ipv4
  <cr>
  flowspec         Address Family modifier
  labeled-unicast  Address Family modifier
  multicast        Address Family modifier
  unicast          Address Family modifier
  vpn              Address Family modifier
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agotopotests: add bgp retain test
Philippe Guibert [Mon, 4 Jul 2022 14:53:47 +0000 (16:53 +0200)]
topotests: add bgp retain test

This test checks that when retain functionality is disabled,
some prefixes are removed from the BGP ipv4 vpn RIB.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: implement retain route-target all behaviour
Philippe Guibert [Fri, 1 Jul 2022 12:50:40 +0000 (14:50 +0200)]
bgpd: implement retain route-target all behaviour

A new command is available under SAFI_MPLS_VPN:

With this command, the BGP vpnvx prefixes received are
not kept, if there are no VRF interested in importing
those vpn entries.

A soft refresh is performed if there is a change of
configuration: retain cmd, vrf import settings, or
route-map change.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agoldpd: Check if the thread is scheduled before calling for remained time
Donatas Abraitis [Mon, 18 Jul 2022 06:53:08 +0000 (09:53 +0300)]
ldpd: Check if the thread is scheduled before calling for remained time

LDPD crashes when hold time is configured to 65535:
(gdb) bt
0  0x00007f8c3fc224bb in raise () from /lib64/libpthread.so.0
1  0x00007f8c4138a3dd in core_handler () from /lib64/libfrr.so.0
2  <signal handler called>
3  0x00007f8c3fc1ccc0 in pthread_mutex_lock () from /lib64/libpthread.so.0
4  0x00007f8c4139914b in thread_timer_remain_msec () from /lib64/libfrr.so.0
5  0x00007f8c41399209 in thread_timer_remain_second () from /lib64/libfrr.so.0
6  0x000000000040eb19 in adj_to_ctl ()
7  0x0000000000427b38 in ldpe_nbr_ctl ()
8  0x000000000042fd68 in control_dispatch_imsg ()
9  0x00007f8c4139a628 in thread_call () from /lib64/libfrr.so.0
10 0x00000000004265fc in ldpe ()
11 0x000000000040a68f in main ()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #11601 from fdumontet6WIND/FMJA/L3VPN
Donatas Abraitis [Mon, 18 Jul 2022 06:14:56 +0000 (09:14 +0300)]
Merge pull request #11601 from fdumontet6WIND/FMJA/L3VPN

bmp add L3VPN support

22 months agopimd: Remove the api from .h file since there is no definition of it
Mobashshera Rasool [Mon, 18 Jul 2022 06:01:52 +0000 (23:01 -0700)]
pimd: Remove the api from .h file since there is no definition of it

Removing the api pim_scan_individual_oil from .h since there is
no definition of it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
22 months agodocker: use Alpine-provided libyang
Quentin Young [Sun, 17 Jul 2022 23:10:45 +0000 (19:10 -0400)]
docker: use Alpine-provided libyang

looks like libyang(2) is back in the upstream alpine repos, so we can
use that instead

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
22 months agoalpine, docker: Update APKBUILD for libyang
Quentin Young [Sun, 17 Jul 2022 21:37:14 +0000 (17:37 -0400)]
alpine, docker: Update APKBUILD for libyang

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
22 months agozebra: Avoid buffer overflow using netlink_parse_rtattr_nested()
Donatas Abraitis [Sun, 17 Jul 2022 19:31:48 +0000 (22:31 +0300)]
zebra: Avoid buffer overflow using netlink_parse_rtattr_nested()

memset(tb, 0, sizeof(struct rtattr *) * (max + 1)); in netlink_parse_rtattr()
seems a good candidate to buffer overflow.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #11622 from donaldsharp/valgrind_issues
Donatas Abraitis [Sun, 17 Jul 2022 18:58:48 +0000 (21:58 +0300)]
Merge pull request #11622 from donaldsharp/valgrind_issues

Valgrind issues

22 months agoMerge pull request #11605 from LabNConsulting/improve-valgrind
Donald Sharp [Sun, 17 Jul 2022 01:13:54 +0000 (21:13 -0400)]
Merge pull request #11605 from LabNConsulting/improve-valgrind

Improve valgrind

22 months agoMerge pull request #11610 from opensourcerouting/fix/treat-as-withdraw_otc
Donald Sharp [Sun, 17 Jul 2022 00:59:32 +0000 (20:59 -0400)]
Merge pull request #11610 from opensourcerouting/fix/treat-as-withdraw_otc

bgpd: OTC attribute should be treated as withdrawal

22 months agozebra: Delete the malloced memory under `show zebra`
Donald Sharp [Sat, 16 Jul 2022 23:01:12 +0000 (19:01 -0400)]
zebra: Delete the malloced memory under `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agozebra: When deleting nexthop group entries ensure the thread is off
Donald Sharp [Sat, 16 Jul 2022 23:00:43 +0000 (19:00 -0400)]
zebra: When deleting nexthop group entries ensure the thread is off

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agolib: Prevent Uninitialized usage of data
Donald Sharp [Sat, 16 Jul 2022 22:59:51 +0000 (18:59 -0400)]
lib: Prevent Uninitialized usage of data

Valgrind is reporting that prefix is being used uninitialized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoMerge pull request #11615 from opensourcerouting/fix/memory_leak_for_community
Jafar Al-Gharaibeh [Sat, 16 Jul 2022 21:03:51 +0000 (16:03 -0500)]
Merge pull request #11615 from opensourcerouting/fix/memory_leak_for_community

bgpd: Fix memory leak for community stuff

22 months agoMerge pull request #11604 from LabNConsulting/working/lb/ospf-parallel-nets
Jafar Al-Gharaibeh [Sat, 16 Jul 2022 20:52:06 +0000 (15:52 -0500)]
Merge pull request #11604 from LabNConsulting/working/lb/ospf-parallel-nets

ospfd: free unreachable router LSA node so that it is not left unreachable

22 months agoMerge pull request #11614 from opensourcerouting/fix/memory_leak_community_alias
Jafar Al-Gharaibeh [Sat, 16 Jul 2022 20:51:48 +0000 (15:51 -0500)]
Merge pull request #11614 from opensourcerouting/fix/memory_leak_community_alias

bgpd: Fix memory leak for community alias

22 months agoospfd: free unreachable router LSA node so that it is not left unreachable
Lou Berger [Thu, 14 Jul 2022 11:40:39 +0000 (07:40 -0400)]
ospfd: free unreachable router LSA node so that it is not left unreachable

       allows for an LSA to be unreachable via one link and reachable via another

Signed-off-by: Lou Berger <lberger@labn.net>
22 months agobgpd: Fix memory leak for community stuff
Donatas Abraitis [Sat, 16 Jul 2022 13:26:13 +0000 (16:26 +0300)]
bgpd: Fix memory leak for community stuff

Do not forget to cleanup after we are done:

==395247== 8,268 (32 direct, 8,236 indirect) bytes in 1 blocks are definitely lost in loss record 199 of 205
==395247==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==395247==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x1FBF63: community_intern (in /usr/lib/frr/bgpd)
==395247==    by 0x1FC0C5: community_parse (in /usr/lib/frr/bgpd)
==395247==    by 0x1F0B66: bgp_attr_community (in /usr/lib/frr/bgpd)
==395247==    by 0x1F4185: bgp_attr_parse (in /usr/lib/frr/bgpd)
==395247==    by 0x26BC29: bgp_update_receive (in /usr/lib/frr/bgpd)
==395247==    by 0x26E887: bgp_process_packet (in /usr/lib/frr/bgpd)
==395247==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Fix memory leak for community alias
Donatas Abraitis [Sat, 16 Jul 2022 13:18:07 +0000 (16:18 +0300)]
bgpd: Fix memory leak for community alias

==361630== 24,780 (96 direct, 24,684 indirect) bytes in 3 blocks are definitely lost in loss record 94 of 97
==361630==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==361630==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1FD3CC: bgp_ca_alias_insert (in /usr/lib/frr/bgpd)
==361630==    by 0x2CF8E5: bgp_community_alias_magic (in /usr/lib/frr/bgpd)
==361630==    by 0x2C980B: bgp_community_alias (in /usr/lib/frr/bgpd)
==361630==    by 0x48E3556: cmd_execute_command_real (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E384B: cmd_execute_command_strict (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3D41: command_config_read_one_line (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3EBA: config_from_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x499065C: vty_read_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4990FF4: vty_read_config (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491CB95: frr_config_read_in (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)
==361630==
==361630== 24,780 (96 direct, 24,684 indirect) bytes in 3 blocks are definitely lost in loss record 95 of 97
==361630==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==361630==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1FD39C: bgp_ca_community_insert (in /usr/lib/frr/bgpd)
==361630==    by 0x2CF8F4: bgp_community_alias_magic (in /usr/lib/frr/bgpd)
==361630==    by 0x2C980B: bgp_community_alias (in /usr/lib/frr/bgpd)
==361630==    by 0x48E3556: cmd_execute_command_real (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E384B: cmd_execute_command_strict (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3D41: command_config_read_one_line (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3EBA: config_from_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x499065C: vty_read_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4990FF4: vty_read_config (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491CB95: frr_config_read_in (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agozebra: correctly display one debug flag about ES Peer
anlan_cs [Fri, 15 Jul 2022 22:29:41 +0000 (18:29 -0400)]
zebra: correctly display one debug flag about ES Peer

Since the `mac->flags` with `ZEBRA_MAC_ES_PEER_ACTIVE` is about ES Peer,
it should be displayed as `PEER Active`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
22 months agoMerge pull request #11564 from kuldeepkash/multicast_pim_bsm
Jafar Al-Gharaibeh [Fri, 15 Jul 2022 21:01:13 +0000 (16:01 -0500)]
Merge pull request #11564 from kuldeepkash/multicast_pim_bsm

tests: Fix multicast_pim_bsm_topo2 static route issue