]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
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: 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>
2 years 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>
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
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
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
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
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
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
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
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
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
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 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
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.
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
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

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

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

2 years 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>
2 years 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>
2 years 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()

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

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

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

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

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

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

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

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

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

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

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

2 years agobgpd: OTC attribute should be treated as withdrawal
Donatas Abraitis [Thu, 14 Jul 2022 20:44:27 +0000 (23:44 +0300)]
bgpd: OTC attribute should be treated as withdrawal

According to RFC9234:

An UPDATE message with a malformed OTC Attribute SHALL be handled
   using the approach of "treat-as-withdraw".

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11606 from LabNConsulting/zebra-nbr-memleak
Jafar Al-Gharaibeh [Thu, 14 Jul 2022 20:04:22 +0000 (15:04 -0500)]
Merge pull request #11606 from LabNConsulting/zebra-nbr-memleak

zebra: free neighbor state before exit to avoid memleaks

2 years agoMerge pull request #11603 from Chromico/master
Donatas Abraitis [Thu, 14 Jul 2022 19:01:51 +0000 (22:01 +0300)]
Merge pull request #11603 from Chromico/master

topotests: Remove typo (extra dot on the IP)

2 years agoMerge pull request #11536 from mobash-rasool/temp1
Jafar Al-Gharaibeh [Thu, 14 Jul 2022 17:24:35 +0000 (12:24 -0500)]
Merge pull request #11536 from mobash-rasool/temp1

pimd: During prune pending, behave as NOINFO state (conformance issue)

2 years agotests: analyze: handle list of strings being returned
Christian Hopps [Thu, 14 Jul 2022 16:04:15 +0000 (12:04 -0400)]
tests: analyze: handle list of strings being returned

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agotests: check memleaks end of module and ignore daemonizing parent
Christian Hopps [Thu, 14 Jul 2022 15:33:39 +0000 (11:33 -0400)]
tests: check memleaks end of module and ignore daemonizing parent

- ignore parent from daemonize valgrind files these allocations will be
checked in the child.
- check for memleaks at end of module/file not just after tests.

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agozebra: free neighbor state before exit to avoid memleaks
Christian Hopps [Thu, 14 Jul 2022 16:20:01 +0000 (12:20 -0400)]
zebra: free neighbor state before exit to avoid memleaks

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agotopotests: Remove typo on IP
Chromico Rek [Thu, 14 Jul 2022 10:10:45 +0000 (14:10 +0400)]
topotests: Remove typo on IP

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
topotests: Remove static route

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
2 years agobmp: add L3VPN support
Francois Dumontet [Mon, 16 May 2022 11:44:06 +0000 (13:44 +0200)]
bmp: add L3VPN support

Support for BMP L3VPN monitoring messages through SAFI_MPLS_VPN address
family.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2 years agoMerge pull request #11598 from patrasar/pim_get_instance
David Lamparter [Wed, 13 Jul 2022 14:54:39 +0000 (16:54 +0200)]
Merge pull request #11598 from patrasar/pim_get_instance

2 years agoMerge pull request #11585 from patrasar/sg_str
David Lamparter [Wed, 13 Jul 2022 14:51:10 +0000 (16:51 +0200)]
Merge pull request #11585 from patrasar/sg_str

2 years agoMerge pull request #11593 from mobash-rasool/fixes
David Lamparter [Wed, 13 Jul 2022 14:49:27 +0000 (16:49 +0200)]
Merge pull request #11593 from mobash-rasool/fixes

2 years agoMerge pull request #11597 from opensourcerouting/pimd-packed-member
mobash-rasool [Wed, 13 Jul 2022 11:59:30 +0000 (17:29 +0530)]
Merge pull request #11597 from opensourcerouting/pimd-packed-member

pimd: fix unaligned accesses

2 years agopimd,pim6d: Set RP to true if the address matches, ignore prefix-length
Mobashshera Rasool [Tue, 12 Jul 2022 08:11:12 +0000 (01:11 -0700)]
pimd,pim6d: Set RP to true if the address matches, ignore prefix-length

The API pim_rp_check_interface_addrs checks if the RP address matches
with the primary address then it returns true.
In case of PIMv4 this condition is true, therefore the router becomes RP.
But in case of PIMv6, this condition does not pass because primary address
for PIMv6 is link-local address.

Also PIMv4 allows secondary addresses to be used as RP
if it is a host route in case primary does not match.

Fixing it by only checking the configured
RP address with the interface address and ignoring the prefix
length since it does not matter.

Fixes: #11335
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #11576 from anlancs/fix/minor-5
mobash-rasool [Wed, 13 Jul 2022 04:12:07 +0000 (09:42 +0530)]
Merge pull request #11576 from anlancs/fix/minor-5

zebra: remove redundant flags assignment

2 years agozebra: remove redundant flags assignment
anlan_cs [Fri, 8 Jul 2022 21:38:26 +0000 (17:38 -0400)]
zebra: remove redundant flags assignment

The assignment of neigh flags on ES peers is set twice. Just clean it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11566 from louis-6wind/rename-mplsvpn
Donatas Abraitis [Tue, 12 Jul 2022 16:09:32 +0000 (19:09 +0300)]
Merge pull request #11566 from louis-6wind/rename-mplsvpn

bgpd: rename "struct bgp" variables in mplsvpn and cleanup

2 years agoMerge pull request #11572 from opensourcerouting/fix/avoid_double_quotes_when_cat
Jafar Al-Gharaibeh [Tue, 12 Jul 2022 15:55:23 +0000 (09:55 -0600)]
Merge pull request #11572 from opensourcerouting/fix/avoid_double_quotes_when_cat

tools: Do not wrap the pidfile into double-quotes for frrcommon.sh

2 years agoMerge pull request #11461 from mobash-rasool/pimv6-enable
Mark Stapp [Tue, 12 Jul 2022 15:44:29 +0000 (11:44 -0400)]
Merge pull request #11461 from mobash-rasool/pimv6-enable

pim6d: Enable/disable pim6d daemons on different platforms based on flags

2 years agoMerge pull request #11285 from iqras23/conditional_def_orig
David Lamparter [Tue, 12 Jul 2022 15:41:09 +0000 (17:41 +0200)]
Merge pull request #11285 from iqras23/conditional_def_orig