]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
18 months agozebra: Cleanup use after free in shutdown
Donald Sharp [Sat, 3 Dec 2022 12:14:54 +0000 (07:14 -0500)]
zebra: Cleanup use after free in shutdown

On shutdown a use after free was being seen of a route table.
Basically the pointer was kept around and resent for cleanup.
Probably something needs to be unwound to make this better
in the future.  Just cleaning up the use after free.

./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-=================================================================
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929:==911929==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000127a00 at pc 0x7fb9ad546f5b bp 0x7ffc3cff0330 sp 0x7ffc3
cff0328
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-READ of size 8 at 0x606000127a00 thread T0
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #0 0x7fb9ad546f5a in route_table_free /home/sharpd/frr8/lib/table.c:103:13
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #1 0x7fb9ad546f04 in route_table_finish /home/sharpd/frr8/lib/table.c:61:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #2 0x6b94ba in zebra_ns_disable_internal /home/sharpd/frr8/zebra/zebra_ns.c:141:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #3 0x6b9158 in zebra_ns_disabled /home/sharpd/frr8/zebra/zebra_ns.c:116:9
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #4 0x7fb9ad43f0f5 in ns_disable_internal /home/sharpd/frr8/lib/netns_linux.c:273:4
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #5 0x7fb9ad43e634 in ns_disable /home/sharpd/frr8/lib/netns_linux.c:368:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #6 0x7fb9ad43e251 in ns_delete /home/sharpd/frr8/lib/netns_linux.c:330:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #7 0x7fb9ad43fbb3 in ns_terminate /home/sharpd/frr8/lib/netns_linux.c:524:3
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #8 0x54f8de in zebra_finalize /home/sharpd/frr8/zebra/main.c:232:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #9 0x7fb9ad5655e6 in thread_call /home/sharpd/frr8/lib/thread.c:2006:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #10 0x7fb9ad3d3343 in frr_run /home/sharpd/frr8/lib/libfrr.c:1198:3
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #11 0x550b48 in main /home/sharpd/frr8/zebra/main.c:476:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #12 0x7fb9acd30d09 in __libc_start_main csu/../csu/libc-start.c:308:16
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #13 0x443549 in _start (/usr/lib/frr/zebra+0x443549)
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-0x606000127a00 is located 0 bytes inside of 56-byte region [0x606000127a00,0x606000127a38)
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-freed by thread T0 here:
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #0 0x4bd33d in free (/usr/lib/frr/zebra+0x4bd33d)
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #1 0x7fb9ad42cc80 in qfree /home/sharpd/frr8/lib/memory.c:141:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #2 0x7fb9ad547305 in route_table_free /home/sharpd/frr8/lib/table.c:141:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #3 0x7fb9ad546f04 in route_table_finish /home/sharpd/frr8/lib/table.c:61:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #4 0x6b94ba in zebra_ns_disable_internal /home/sharpd/frr8/zebra/zebra_ns.c:141:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #5 0x6b9692 in zebra_ns_early_shutdown /home/sharpd/frr8/zebra/zebra_ns.c:164:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #6 0x7fb9ad43f228 in ns_walk_func /home/sharpd/frr8/lib/netns_linux.c:386:9
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #7 0x55014f in sigint /home/sharpd/frr8/zebra/main.c:194:2
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #8 0x7fb9ad50db99 in frr_sigevent_process /home/sharpd/frr8/lib/sigevent.c:130:6
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #9 0x7fb9ad560d07 in thread_fetch /home/sharpd/frr8/lib/thread.c:1775:4
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #10 0x7fb9ad3d332d in frr_run /home/sharpd/frr8/lib/libfrr.c:1197:9
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #11 0x550b48 in main /home/sharpd/frr8/zebra/main.c:476:2
--
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-    #7 0x7fb9acd30d09 in __libc_start_main csu/../csu/libc-start.c:308:16
./bfd_vrf_topo1.test_bfd_vrf_topo1/r2.zebra.asan.911929-

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoldpd: Clean up use after free in shutdown
Donald Sharp [Sat, 3 Dec 2022 12:13:49 +0000 (07:13 -0500)]
ldpd: Clean up use after free in shutdown

Config data was being freed just prior to it
being used for cleanup in shutdown.  Prevent this
from happening.

./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-=================================================================
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142:==2274142==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d00000c880 at pc 0x0000004d94d1 bp 0x7ffd46637810 sp 0
x7ffd46637808
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-READ of size 4 at 0x61d00000c880 thread T0
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #0 0x4d94d0 in ldp_rtr_id_get /home/sharpd/frr8/ldpd/ldpd.c:983:20
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #1 0x56ff92 in gen_ldp_hdr /home/sharpd/frr8/ldpd/packet.c:47:19
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #2 0x56a4b0 in send_notification_full /home/sharpd/frr8/ldpd/notification.c:49:9
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #3 0x56c4b3 in send_notification /home/sharpd/frr8/ldpd/notification.c:117:2
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #4 0x573fb7 in session_shutdown /home/sharpd/frr8/ldpd/packet.c:666:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #5 0x4e2ef1 in adj_del /home/sharpd/frr8/ldpd/adjacency.c:145:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #6 0x55d425 in ldpe_shutdown /home/sharpd/frr8/ldpd/ldpe.c:231:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #7 0x55a9a0 in ldpe_dispatch_main /home/sharpd/frr8/ldpd/ldpe.c:631:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #8 0x7f0c00c035e6 in thread_call /home/sharpd/frr8/lib/thread.c:2006:2
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #9 0x5586f2 in ldpe /home/sharpd/frr8/ldpd/ldpe.c:138:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #10 0x4d46d2 in main /home/sharpd/frr8/ldpd/ldpd.c:339:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #11 0x7f0c00476d09 in __libc_start_main csu/../csu/libc-start.c:308:16
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #12 0x429cb9 in _start (/usr/lib/frr/ldpd+0x429cb9)
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-0x61d00000c880 is located 0 bytes inside of 2008-byte region [0x61d00000c880,0x61d00000d058)
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-freed by thread T0 here:
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #0 0x4a3aad in free (/usr/lib/frr/ldpd+0x4a3aad)
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #1 0x4de6c8 in config_clear /home/sharpd/frr8/ldpd/ldpd.c:2001:2
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #2 0x55d12d in ldpe_shutdown /home/sharpd/frr8/ldpd/ldpe.c:211:2
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #3 0x55a9a0 in ldpe_dispatch_main /home/sharpd/frr8/ldpd/ldpe.c:631:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #4 0x7f0c00c035e6 in thread_call /home/sharpd/frr8/lib/thread.c:2006:2
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #5 0x5586f2 in ldpe /home/sharpd/frr8/ldpd/ldpe.c:138:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #6 0x4d46d2 in main /home/sharpd/frr8/ldpd/ldpd.c:339:3
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #7 0x7f0c00476d09 in __libc_start_main csu/../csu/libc-start.c:308:16
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-previously allocated by thread T0 here:
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #0 0x4a3ea2 in calloc (/usr/lib/frr/ldpd+0x4a3ea2)
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #1 0x4d6146 in config_new_empty /home/sharpd/frr8/ldpd/ldpd.c:1967:10
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #2 0x558678 in ldpe /home/sharpd/frr8/ldpd/ldpe.c:134:11
--
./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-    #4 0x7f0c00476d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #12437 from proelbtn/proelbtn-fix-srv6-tests
Donald Sharp [Mon, 5 Dec 2022 12:38:18 +0000 (07:38 -0500)]
Merge pull request #12437 from proelbtn/proelbtn-fix-srv6-tests

bgpd, tests: Fix topotests for SRv6 L3VPN and misuse of sid_unregister

18 months agoMerge pull request #12439 from opensourcerouting/feature/docker_build_and_push_latest
Donald Sharp [Mon, 5 Dec 2022 12:36:40 +0000 (07:36 -0500)]
Merge pull request #12439 from opensourcerouting/feature/docker_build_and_push_latest

docker: Build docker images with Github Actions

18 months agoMerge pull request #12440 from opensourcerouting/fix/community_list_match_or
Donald Sharp [Mon, 5 Dec 2022 12:36:01 +0000 (07:36 -0500)]
Merge pull request #12440 from opensourcerouting/fix/community_list_match_or

doc: Fix BGP community-list misleading example

18 months agoMerge pull request #12442 from cscarpitta/fix/fix-srv6-behavior-in-config-write
Donald Sharp [Mon, 5 Dec 2022 12:33:46 +0000 (07:33 -0500)]
Merge pull request #12442 from cscarpitta/fix/fix-srv6-behavior-in-config-write

zebra: Fix missing newline character in the of SRv6 config write function

18 months agozebra: Add missing newline in SRv6 config write
Carmine Scarpitta [Mon, 5 Dec 2022 08:08:23 +0000 (09:08 +0100)]
zebra: Add missing newline in SRv6 config write

The `behavior usid` command is installed under the SRv6 Locator node in
the zebra VTY. However, in the SRv6 config write function this command
is wrongly put on the same line as the `prefix X:X::X:X/M` command.
This causes a failure when an SRv6 uSID locator is configured in zebra
and  `frr-reload.py` is used to reload the FRR configuration.

This commit prepends a newline character to the  `behavior usid` command
in the SRv6 config write function. The output of `show running-config`
before and after this commit is shown below.

Before:

```
Building configuration...

Current configuration:
!
frr version 8.5-dev
!
segment-routing
 srv6
  locators
   locator loc1
    prefix fc00:0:1::/48 block-len 32 node-len 16    behavior usid
   exit
   !
  exit
  !
 exit
 !
exit
!
end
```

After:

```
Building configuration...

Current configuration:
!
segment-routing
 srv6
  locators
   locator loc1
    prefix fc00:0:1::/48 block-len 32 node-len 16
    behavior usid
   exit
   !
  exit
  !
 exit
 !
exit
!
end
```

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agodoc: Update BGP community-list handling example
Donatas Abraitis [Sun, 4 Dec 2022 20:28:26 +0000 (22:28 +0200)]
doc: Update BGP community-list handling example

Documentation ways that community-list works as OR when multiple community
values specified per entry, but it's wrong. It must be AND, let's fix this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Check if community-list works as expected
Donatas Abraitis [Sun, 4 Dec 2022 19:52:05 +0000 (21:52 +0200)]
tests: Check if community-list works as expected

AND/OR cases.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agogithub: Build `master` daily docker images and for stable/X.Y on push
Donatas Abraitis [Fri, 2 Dec 2022 16:06:23 +0000 (18:06 +0200)]
github: Build `master` daily docker images and for stable/X.Y on push

frrouting/frr:master will be generated every day
frrouting/frr:vX.Y.Z will be generated every time a new push is done on the
stable/X.Y branch.

Takes up to 3 hours to build and publish images.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Fix delete_vrf_tovpn_sid
Ryoga Saito [Sun, 4 Dec 2022 07:53:48 +0000 (16:53 +0900)]
bgpd: Fix delete_vrf_tovpn_sid

The first argument of sid_unregister should be default bgp instance.
However, these functions passed VRF bgp instance to this funciton.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
18 months agotests: Fix topotests for bgp_srv6l3vpn
Ryoga Saito [Sun, 4 Dec 2022 07:51:24 +0000 (16:51 +0900)]
tests: Fix topotests for bgp_srv6l3vpn

In bgp_srv6l3vpn tests, check_ping checks reachability. However, this
function have a bug and if we set expect_connected to True, check will
pass even if all ping packets are lost. This commit fixes this issue.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
18 months agoMerge pull request #12429 from opensourcerouting/fix/bgp_nits
Donald Sharp [Fri, 2 Dec 2022 15:42:18 +0000 (10:42 -0500)]
Merge pull request #12429 from opensourcerouting/fix/bgp_nits

bgpd: Cosmetic changes

18 months agodocker: Use Alpine 3.17 as base image
Donatas Abraitis [Fri, 2 Dec 2022 13:42:00 +0000 (15:42 +0200)]
docker: Use Alpine 3.17 as base image

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Fix unaligned output of advertised-routes, bestpath-routes, etc.
Donatas Abraitis [Fri, 2 Dec 2022 08:36:32 +0000 (10:36 +0200)]
bgpd: Fix unaligned output of advertised-routes, bestpath-routes, etc.

This commit eaeba5e868fccba4b48145bc953774faf01a121a changed a bit a formatting,
but this part was missed, let's fix it.

An example before the patch:

```
r3# sh ip bgp ipv4 labeled-unicast neighbors 192.168.34.4 advertised-routes
BGP table version is 3, local router ID is 192.168.34.3, vrf id 0
Default local pref 100, local AS 65003
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
*> 10.0.0.1/32      0.0.0.0                                0 65001 ?

Total number of prefixes 1
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Do not print cumulated bandwidth prefixed with `u`
Donatas Abraitis [Fri, 2 Dec 2022 08:20:10 +0000 (10:20 +0200)]
bgpd: Do not print cumulated bandwidth prefixed with `u`

This seems just a mistake, drop `u` prefix.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #12427 from mjstapp/pim6d_enabled
Jafar Al-Gharaibeh [Fri, 2 Dec 2022 05:55:55 +0000 (23:55 -0600)]
Merge pull request #12427 from mjstapp/pim6d_enabled

build: enable pim6d by default

18 months agobuild: enable pim6d by default
Mark Stapp [Thu, 1 Dec 2022 18:57:46 +0000 (13:57 -0500)]
build: enable pim6d by default

Change configure.ac so that pim6d is enabled by default; a
command-line option can disable it.

Signed-off-by: Mark Stapp <mjs@labn.net>
18 months agoMerge pull request #12397 from opensourcerouting/vscode-intro
Donald Sharp [Thu, 1 Dec 2022 16:01:45 +0000 (11:01 -0500)]
Merge pull request #12397 from opensourcerouting/vscode-intro

lib: handle visual studio code C/C++ extension

18 months agoMerge pull request #12418 from opensourcerouting/fix/tests_for_while_true
Donald Sharp [Thu, 1 Dec 2022 16:00:23 +0000 (11:00 -0500)]
Merge pull request #12418 from opensourcerouting/fix/tests_for_while_true

Fix old tests with `while true`

18 months agoMerge pull request #12425 from cscarpitta/fix/fix-bgp-srv6l3vpn-to-bgp-vrf2-topotest
Rafael Zalamena [Thu, 1 Dec 2022 10:46:52 +0000 (07:46 -0300)]
Merge pull request #12425 from cscarpitta/fix/fix-bgp-srv6l3vpn-to-bgp-vrf2-topotest

tests: Fix `bgp_srv6l3vpn_to_bgp_vrf2` topotest failures

18 months agotests: Fix `bgp_srv6l3vpn_to_bgp_vrf2` topotest
Carmine Scarpitta [Wed, 30 Nov 2022 21:18:49 +0000 (22:18 +0100)]
tests: Fix `bgp_srv6l3vpn_to_bgp_vrf2` topotest

The `bgp_srv6l3vpn_to_bgp_vrf2` topotest tests the SRv6 IPv4 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.

The topotest expects to find the AS-Path in the RIB, which is only
present if the `bgp send-extra-data zebra` option is enabled in the
`bgpd` configuration.

Currently, the `bgp send-extra-data zebra` option is not set in the
`bgpd` configuration, which always causes the topotest to fail.

This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf2` topotest by enabling
the `bgp send-extra-data zebra` option for both routers `r1` and `r2`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agoMerge pull request #12325 from AbhishekNR/ttable_pim_nexthop
Donatas Abraitis [Wed, 30 Nov 2022 19:40:30 +0000 (21:40 +0200)]
Merge pull request #12325 from AbhishekNR/ttable_pim_nexthop

pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command output

18 months agoMerge pull request #12416 from opensourcerouting/fix/inet_ntop
mobash-rasool [Wed, 30 Nov 2022 18:27:11 +0000 (23:57 +0530)]
Merge pull request #12416 from opensourcerouting/fix/inet_ntop

bgpd: inet_ntop() adjustments

18 months agotests: Improve `bgp_maximum_prefix_invalid_update` test case
Donatas Abraitis [Wed, 30 Nov 2022 15:22:43 +0000 (17:22 +0200)]
tests: Improve `bgp_maximum_prefix_invalid_update` test case

Drop `grep'ing` stuff, and check JSON data if notification was send or not.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #12367 from rgirada/ospf_valgrind_fix
Russ White [Tue, 29 Nov 2022 16:23:27 +0000 (11:23 -0500)]
Merge pull request #12367 from rgirada/ospf_valgrind_fix

ospfd: Fixing a memleak.

18 months agobgpd: inet_ntop() adjustments
Donatas Abraitis [Tue, 29 Nov 2022 08:23:20 +0000 (10:23 +0200)]
bgpd: inet_ntop() adjustments

Use %pI4/%pI6 where possible, otherwise at least atjust stack buffer sizes
for inet_ntop() calls.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #12334 from ylopez/patch-1
Russ White [Tue, 29 Nov 2022 15:11:32 +0000 (10:11 -0500)]
Merge pull request #12334 from ylopez/patch-1

Increase maximum packet size in ospf API

18 months agoMerge pull request #12384 from opensourcerouting/feature/snmp_bgp4V2PeerErrorsTable
Russ White [Tue, 29 Nov 2022 15:05:29 +0000 (10:05 -0500)]
Merge pull request #12384 from opensourcerouting/feature/snmp_bgp4V2PeerErrorsTable

bgpd: Implement SNMP BGP4V2-MIB (bgp4V2PeerErrorsTable)

18 months agoMerge pull request #12386 from opensourcerouting/bfd-ipv4-source-bind
Russ White [Tue, 29 Nov 2022 15:03:44 +0000 (10:03 -0500)]
Merge pull request #12386 from opensourcerouting/bfd-ipv4-source-bind

bfdd: fix IPv4 socket source selection

18 months agobgpd: Adjust received prefix count only when we validate the nexthop
Donatas Abraitis [Tue, 29 Nov 2022 14:56:36 +0000 (16:56 +0200)]
bgpd: Adjust received prefix count only when we validate the nexthop

bgp_pcount_adjust() is called only when calling bgp_path_info_set_flag().

Before this patch the pcount is not advanced before checking for overflow.

Additionally, print:

```
[RZMGQ-A03CG] 192.168.255.1(r1) rcvd UPDATE about 172.16.255.254/32 IPv4 unicast -- DENIED due to: maximum-prefix overflow
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Refactor bgp_maximum_prefix_invalid_update test case
Donatas Abraitis [Tue, 29 Nov 2022 13:30:11 +0000 (15:30 +0200)]
tests: Refactor bgp_maximum_prefix_invalid_update test case

Just drop `while true` stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #12329 from opensourcerouting/feature/graceful-shutdown_per_peer
Russ White [Tue, 29 Nov 2022 13:47:20 +0000 (08:47 -0500)]
Merge pull request #12329 from opensourcerouting/feature/graceful-shutdown_per_peer

bgpd: Implement graceful-shutdown command per neighbor

18 months agotests: Refactor bgp_local_as_private_remove test case
Donatas Abraitis [Tue, 29 Nov 2022 13:19:56 +0000 (15:19 +0200)]
tests: Refactor bgp_local_as_private_remove test case

Just drop `while true` stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Refactor bgp_comm-list_delete test case
Donatas Abraitis [Tue, 29 Nov 2022 13:08:09 +0000 (15:08 +0200)]
tests: Refactor bgp_comm-list_delete test case

Just drop `while true` stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #12413 from donaldsharp/misc_and_then_some
Donatas Abraitis [Tue, 29 Nov 2022 08:27:43 +0000 (10:27 +0200)]
Merge pull request #12413 from donaldsharp/misc_and_then_some

Misc and then some

18 months agoMerge pull request #12375 from chiragshah6/fdev1
Donatas Abraitis [Tue, 29 Nov 2022 07:39:53 +0000 (09:39 +0200)]
Merge pull request #12375 from chiragshah6/fdev1

zebra: json support for show ip nht

18 months agozebra: json support for show ip nht
Sindhu Parvathi Gopinathan [Tue, 15 Nov 2022 03:33:56 +0000 (19:33 -0800)]
zebra: json support for show ip nht

show ip/ipv6 nht vrf <all | name> json support added.

Commands enhanced with JSON:
----------------------------
show ip nht json
show ip nht <addr> json
show ipv6 nht json
show ipv6 nht <addr> json
show ip nht vrf <name> json
show ip nht vrf all json
show ipv6 nht vrf <name> json
show ipv6 nht vrf all json
show ip nht vrf default <addr> json
show ipv6 nht vrf default <addr> json

Sample JSON output:
-------------------

tor-1# show ip nht vrf default json
{
  "default":{
    "nexthops":{
      "27.0.0.5":{
        "nhtConnected":false,
        "clientList":[
          {
            "protocol":"bgp",
            "socket":70,
            "protocolFiltered":"none"
          }
        ],
        "gates":[
          {
            "ip":"fe80::202:ff:fe00:2b",
            "interface":"uplink_1"
          },
          {
            "ip":"fe80::202:ff:fe00:35",
            "interface":"uplink_2"
          }
        ],
        "resolvedProtocol":"bgp"
      },
      "27.0.0.6":{
        "nhtConnected":false,
        "clientList":[
          {
            "protocol":"bgp",
            "socket":70,
            "protocolFiltered":"none"
          }
        ],
        "gates":[
          {
            "ip":"fe80::202:ff:fe00:2b",
            "interface":"uplink_1"
          },
          {
            "ip":"fe80::202:ff:fe00:35",
            "interface":"uplink_2"
          }
        ],
        "resolvedProtocol":"bgp"
      }
    }
  }
}

tor-1# show ipv6 nht vrf default json
{
  "default": {
    "nexthops": {
      "fe80::202:ff:fe00:25": {
        "nhtConnected": true,
        "clientList": [
          {
            "protocol": "bgp",
            "socket": 45,
            "protocolFiltered": "none"
          }
        ],
        "gates": [
          {
            "interface": "swp1",
            "directlyConnected": true
          }
        ],
        "resolvedProtocol": "connected"
      },
      "fe80::202:ff:fe00:2b": {
        "nhtConnected": true,
        "clientList": [
          {
            "protocol": "bgp",
            "socket": 45,
            "protocolFiltered": "none"
          }
        ],
        "gates": [
          {
            "interface": "swp1",
            "directlyConnected": true
          }
        ],
        "resolvedProtocol": "connected"
      }
    }
  }
}

tor-1# show ipv6 nht vrf all json
{
  "default": {
    "nexthops": {
      "fe80::202:ff:fe00:25": {
        "nhtConnected": true,
        "clientList": [
          {
            "protocol": "bgp",
            "socket": 45,
            "protocolFiltered": "none"
          }
        ],
        "gates": [
          {
            "interface": "swp1",
            "directlyConnected": true
          }
        ],
        "resolvedProtocol": "connected"
      },
      "fe80::202:ff:fe00:2b": {
        "nhtConnected": true,
        "clientList": [
          {
            "protocol": "bgp",
            "socket": 45,
            "protocolFiltered": "none"
          }
        ],
        "gates": [
          {
            "interface": "swp1",
            "directlyConnected": true
          }
        ],
        "resolvedProtocol": "connected"
      }
    }
  },
  "mgmt": {
    "nexthops": {}
  },
  "sym_1": {
    "nexthops": {}
  }
}

Ticket:#3229013
Issue:3229013

Testing Done: Unit test completed.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
18 months agoMerge pull request #12414 from opensourcerouting/fix/update_workflow
Jafar Al-Gharaibeh [Mon, 28 Nov 2022 19:36:54 +0000 (14:36 -0500)]
Merge pull request #12414 from opensourcerouting/fix/update_workflow

Some doc changes

18 months agodoc: Do not forget to update the reference table for release dates
Donatas Abraitis [Mon, 28 Nov 2022 15:31:29 +0000 (17:31 +0200)]
doc: Do not forget to update the reference table for release dates

As a part of release, an additional checkpoint when creating a stabilization
branch.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agodoc: Update release dates and add a hint on how to get dates correctly
Donatas Abraitis [Mon, 28 Nov 2022 15:26:39 +0000 (17:26 +0200)]
doc: Update release dates and add a hint on how to get dates correctly

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoospf6d: Consolidate to ospf6_route_is_identical
Donald Sharp [Mon, 28 Nov 2022 14:46:39 +0000 (09:46 -0500)]
ospf6d: Consolidate to ospf6_route_is_identical

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoospf6d: ospf6_route_cmp_nexthops make return sane
Donald Sharp [Mon, 28 Nov 2022 14:41:03 +0000 (09:41 -0500)]
ospf6d: ospf6_route_cmp_nexthops make return sane

The ospf6_route_cmp_nexthops function was returning 0 for same
and 1 for not same.  Let's reverse the polarity and actually make
the returns useful long term.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoospfd: Do not auto-debug DR-Election notifications
Donald Sharp [Mon, 28 Nov 2022 13:57:38 +0000 (08:57 -0500)]
ospfd: Do not auto-debug DR-Election notifications

Every 1/2 hour my logs are filling up with this:
2022-11-26 13:54:47.531 [DEBG] ospfd: [P4PQ9-K4XFD] DR-Election[1st]: Backup 192.168.119.229
2022-11-26 13:54:47.531 [DEBG] ospfd: [HBZ7F-65Y86] DR-Election[1st]: DR     192.168.119.229
2022-11-26 13:54:47.531 [DEBG] ospfd: [H01MF-RN00N] DR-Election[2nd]: Backup 0.0.0.0
2022-11-26 13:54:47.531 [DEBG] ospfd: [R7BJ4-KP8JT] DR-Election[2nd]: DR     192.168.119.229

This should be guarded by an if check to ensure that the operator really
wants to see this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoospfd: Do not always debug joining AllDRouters Multicast group
Donald Sharp [Mon, 28 Nov 2022 13:53:20 +0000 (08:53 -0500)]
ospfd: Do not always debug joining AllDRouters Multicast group

My log file is filling up with:
2022-11-26 13:24:47.532 [DEBG] ospfd: [RY794-DQ7AK] interface 192.168.119.229 [2] join AllDRouters Multicast group.

Every 1/2 hour.  There is nothing an operator needs to do here and nothing
that they can change.  Let's guard this output.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agobgpd: Null checking is not needed on failure
Donald Sharp [Mon, 28 Nov 2022 13:52:48 +0000 (08:52 -0500)]
bgpd: Null checking is not needed on failure

Memory allocations that fail crash the program.  Checking
for NULL is not going to do anything.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #12389 from opensourcerouting/ospf6d-asbr-infinite-loop
Donald Sharp [Mon, 28 Nov 2022 13:45:50 +0000 (08:45 -0500)]
Merge pull request #12389 from opensourcerouting/ospf6d-asbr-infinite-loop

ospf6d: fix infinite loop when adding ASBR route

18 months agoMerge pull request #12405 from opensourcerouting/static-improv
Donald Sharp [Mon, 28 Nov 2022 13:13:09 +0000 (08:13 -0500)]
Merge pull request #12405 from opensourcerouting/static-improv

staticd: improve CLI/northbound translation code

18 months agoMerge pull request #12342 from opensourcerouting/fix/small_waiting_times
Donald Sharp [Mon, 28 Nov 2022 13:10:23 +0000 (08:10 -0500)]
Merge pull request #12342 from opensourcerouting/fix/small_waiting_times

tests: Fail tests immediately if they use too low wait/count values

18 months agoMerge pull request #12363 from opensourcerouting/feature/add_size_label_github
Donald Sharp [Mon, 28 Nov 2022 12:48:52 +0000 (07:48 -0500)]
Merge pull request #12363 from opensourcerouting/feature/add_size_label_github

github: Create size label for every PR

18 months agoMerge pull request #12408 from opensourcerouting/fix/mpls_vtysh_print
Donald Sharp [Mon, 28 Nov 2022 12:48:16 +0000 (07:48 -0500)]
Merge pull request #12408 from opensourcerouting/fix/mpls_vtysh_print

zebra: Use `mpls enable`, not `mpls` when generating a config

18 months agolib: handle visual studio code C/C++ extension
Rafael Zalamena [Mon, 28 Nov 2022 11:19:59 +0000 (08:19 -0300)]
lib: handle visual studio code C/C++ extension

Add some `pragma`s to handle errors that the C/C++ extension is not able
to understand.

Move `TRANSPARENT_UNION` to `lib/compiler.h` for consistency.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
18 months agoMerge pull request #12369 from mruprich/frr-run-as-non-root
Donatas Abraitis [Mon, 28 Nov 2022 09:31:36 +0000 (11:31 +0200)]
Merge pull request #12369 from mruprich/frr-run-as-non-root

tools: Enable start of FRR for non-root user

18 months agozebra: Use `mpls enable`, not `mpls` when generating a config
Donatas Abraitis [Mon, 28 Nov 2022 09:14:06 +0000 (11:14 +0200)]
zebra: Use `mpls enable`, not `mpls` when generating a config

If we enable MPLS for an interface via sysctl, we should write `mpls enable`,
not `mpls`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #12403 from donaldsharp/echo_exclusion
Donatas Abraitis [Mon, 28 Nov 2022 08:07:44 +0000 (10:07 +0200)]
Merge pull request #12403 from donaldsharp/echo_exclusion

Echo exclusion

19 months agoMerge pull request #12399 from opensourcerouting/fix/static_color_crash
mobash-rasool [Sat, 26 Nov 2022 19:25:40 +0000 (00:55 +0530)]
Merge pull request #12399 from opensourcerouting/fix/static_color_crash

staticd: Fix crash for an existing route with color

19 months agolib: Do not log `echo PING` commands from watchfrr
Donald Sharp [Sat, 26 Nov 2022 14:23:50 +0000 (09:23 -0500)]
lib: Do not log `echo PING` commands from watchfrr

Since the `echo PING` commands are from watchfrr and are sent
a whole bunch when an operator has `log commands` on the amount
of logging done is quite significant.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agozebra: Fix tracepoint changes for lttng
Donald Sharp [Sat, 26 Nov 2022 14:28:14 +0000 (09:28 -0500)]
zebra: Fix tracepoint changes for lttng

The recent tracepoint additions in c317d3f246769e8261df0f9d1eb787bea7b5da06
did not properly setup the tracepoints for lttng.  Fix this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agostaticd: improve CLI/northbound translation code
Rafael Zalamena [Fri, 25 Nov 2022 18:59:21 +0000 (15:59 -0300)]
staticd: improve CLI/northbound translation code

Simplify all DEFUNs by moving all logic to the northbound translation
function and transforming all function parameters into a single
structure.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
19 months agoMerge pull request #12370 from opensourcerouting/fix/crash_rmap_vpn_nexthop
Jafar Al-Gharaibeh [Fri, 25 Nov 2022 15:18:40 +0000 (10:18 -0500)]
Merge pull request #12370 from opensourcerouting/fix/crash_rmap_vpn_nexthop

bgpd: Fix crash for `set ipv4/ipv6 vpn next-hop` command

19 months agostaticd: Do not crash when modifying an existing static route with color
Donatas Abraitis [Fri, 25 Nov 2022 14:19:28 +0000 (16:19 +0200)]
staticd: Do not crash when modifying an existing static route with color

```
$ vtysh -c 'conf' -c 'ip route 192.168.0.0/32 192.168.10.65 color 123'
$ vtysh -c 'show ip route 192.168.0.0/32 json' | jq '."192.168.0.0/32"[0].nexthops[0].srteColor'
123
$ vtysh -c 'conf' -c 'ip route 192.168.0.0/32 192.168.10.65'
$ vtysh -c 'show ip route 192.168.0.0/32 json' | jq '."192.168.0.0/32"[0].nexthops[0].srteColor'
0
```

Before this patch:
```
STATIC: Received signal 6 at 1666938633 (si_addr 0x4e1a, PC 0x7f295139c438); aborting...
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(zlog_backtrace_sigsafe+0x70) [0x7f29519ef0a0]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(zlog_signal+0xec) [0x7f29519ef28c]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xccee2) [0x7f2951a1aee2]
STATIC: /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f2951742390]
STATIC: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f295139c438]
STATIC: /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f295139e03a]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(_zlog_assert_failed+0xe6) [0x7f2951a46766]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xae7ee) [0x7f29519fc7ee]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd(routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xaf264) [0x7f29519fd264]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xafb4f) [0x7f29519fdb4f]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(nb_candidate_commit_apply+0x33) [0x7f29519fde33]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(nb_candidate_commit+0x9e) [0x7f29519fdf6e]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xb0469) [0x7f29519fe469]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xb3055) [0x7f2951a01055]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(nb_cli_apply_changes+0xd8) [0x7f2951a01358]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd() [0x407ec2]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd() [0x40a307]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0x74923) [0x7f29519c2923]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(cmd_execute_command+0xe4) [0x7f29519c2aa4]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(cmd_execute+0xc9) [0x7f29519c2c49]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xe4184) [0x7f2951a32184]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xe4436) [0x7f2951a32436]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xe6fcc) [0x7f2951a34fcc]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(thread_call+0x98) [0x7f2951a2cc28]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(frr_run+0xe8) [0x7f29519e7518]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd(main+0xda) [0x40572a]
STATIC: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f2951387840]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd(_start+0x29) [0x4058e9]
STATIC: in thread vtysh_read scheduled from lib/vty.c:2710 vty_event()
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12392 from patrasar/pimv6_bsm_cli
Donatas Abraitis [Fri, 25 Nov 2022 09:01:46 +0000 (11:01 +0200)]
Merge pull request #12392 from patrasar/pimv6_bsm_cli

pim6d: Fix RpAddress in "show ipv6 pim bsm-database"

19 months agoMerge pull request #12371 from proelbtn/fix-frr-reload-doesnot-work
Donatas Abraitis [Fri, 25 Nov 2022 07:20:50 +0000 (09:20 +0200)]
Merge pull request #12371 from proelbtn/fix-frr-reload-doesnot-work

bgpd: Fix the order of SRv6 locator parameters

19 months agopim6d: Fix RpAddress in "show ipv6 pim bsm-database"
Sarita Patra [Fri, 25 Nov 2022 06:43:15 +0000 (22:43 -0800)]
pim6d: Fix RpAddress in "show ipv6 pim bsm-database"

The fix for issue #12089 was reverted while resolving conflict
for PR https://github.com/FRRouting/frr/pull/11600/.

Signed-off-by: Sarita Patra <saritap@vmware.com>
19 months agoospf6d: fix infinite loop when adding ASBR route
Renato Westphal [Thu, 24 Nov 2022 01:14:51 +0000 (22:14 -0300)]
ospf6d: fix infinite loop when adding ASBR route

Commit 8f359e1593c414322 removed a check that prevented the same route
from being added twice. In certain topologies, that change resulted in
the following infinite loop when adding an ASBR route:

ospf6_route_add
 ospf6_top_brouter_hook_add
  ospf6_abr_examin_brouter
   ospf6_abr_examin_summary
    ospf6_route_add
     (repeat until stack overflow)

Revert the offending commit and update `ospf6_route_is_identical()` to
not do comparison using `memcmp()`.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
19 months agoMerge pull request #12317 from mobash-rasool/ospf-fixes
Russ White [Thu, 24 Nov 2022 15:21:25 +0000 (10:21 -0500)]
Merge pull request #12317 from mobash-rasool/ospf-fixes

ospfd: Fix RFC conformance test cases 25.19 and 27.6

19 months agobgpd: Implement BGP4V2-MIB (bgp4V2PeerErrorsTable)
Donatas Abraitis [Thu, 24 Nov 2022 11:08:39 +0000 (13:08 +0200)]
bgpd: Implement BGP4V2-MIB (bgp4V2PeerErrorsTable)

```
iso.3.6.1.3.5.1.1.3.1.1.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.1.1.4.192.168.10.65 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.1.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.1.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.1.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.2.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.2.1.4.192.168.10.65 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.2.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.2.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.2.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.3.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.3.1.4.192.168.10.65 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.3.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.3.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.3.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.4.1.4.192.168.10.64 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.4.1.4.192.168.10.65 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.4.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.4.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.4.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.5.1.4.192.168.10.64 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.5.1.4.192.168.10.65 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.5.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.5.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.5.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.6.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.6.1.4.192.168.10.65 = Gauge32: 6
iso.3.6.1.3.5.1.1.3.1.6.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.6.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.6.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.7.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.7.1.4.192.168.10.65 = Gauge32: 2
iso.3.6.1.3.5.1.1.3.1.7.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.7.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.7.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.3.1.8.1.4.192.168.10.64 = Gauge32: 22223
iso.3.6.1.3.5.1.1.3.1.8.1.4.192.168.10.65 = Gauge32: 22227
iso.3.6.1.3.5.1.1.3.1.8.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 22223
iso.3.6.1.3.5.1.1.3.1.8.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 22223
iso.3.6.1.3.5.1.1.3.1.8.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 22223
iso.3.6.1.3.5.1.1.3.1.9.1.4.192.168.10.64 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.9.1.4.192.168.10.65 = Hex-STRING: 4F 4B 00
iso.3.6.1.3.5.1.1.3.1.9.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.9.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.9.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.10.1.4.192.168.10.64 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.10.1.4.192.168.10.65 = Hex-STRING: 02 4F 4B 00
iso.3.6.1.3.5.1.1.3.1.10.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.10.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00
iso.3.6.1.3.5.1.1.3.1.10.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Keep the notification data under peer's struct when sending
Donatas Abraitis [Thu, 24 Nov 2022 11:07:32 +0000 (13:07 +0200)]
bgpd: Keep the notification data under peer's struct when sending

Before this patch, data is flushed, and we can't see the data after we send
the notification.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobfdd: fix IPv4 socket source selection
Rafael Zalamena [Thu, 24 Nov 2022 14:16:18 +0000 (11:16 -0300)]
bfdd: fix IPv4 socket source selection

The imported BFD code had some logic to ignore the source address when
using single hop IPv4. The BFD peer socket function should allow the
source to be selected so we can:
1. Select the source address in the outgoing packets
2. Only receive packets from that specific source

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
19 months agotests: Correct srv6 locator testcases
Ryoga Saito [Wed, 23 Nov 2022 04:57:02 +0000 (13:57 +0900)]
tests: Correct srv6 locator testcases

Previous commit changes the order of srv6 locator parameters. So, this
PR reflect the previous changes.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
19 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 pim bsrp-info" command output
Abhishek N R [Mon, 21 Nov 2022 05:23:23 +0000 (21:23 -0800)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim bsrp-info" command output

Fixes: #11246
Signed-off-by: Abhishek N R <abnr@vmware.com>
19 months agoMerge pull request #12374 from sworleys/VRF-Disable
Donatas Abraitis [Thu, 24 Nov 2022 07:28:42 +0000 (09:28 +0200)]
Merge pull request #12374 from sworleys/VRF-Disable

lib: disable vrf before terminating interfaces

19 months agoMerge pull request #12365 from chiragshah6/fdev2
Donatas Abraitis [Thu, 24 Nov 2022 07:03:47 +0000 (09:03 +0200)]
Merge pull request #12365 from chiragshah6/fdev2

bgpd: JSON support for show ip bgp vrf all update-group

19 months agobgpd: JSON support for show ip bgp vrf all update-group
Ashwini Reddy [Mon, 7 Nov 2022 19:53:48 +0000 (11:53 -0800)]
bgpd: JSON support for show ip bgp vrf all update-group

Ticket:#3229030
Testing Done: UT

Changes:

 - JSON support for the update group command.

Testing:

torc-11# show ip bgp vrf all ipv6 update-groups json

torc-12# show bgp vrf all update-groups json
{
  "default":{
    "2":{
      "groupCreateTime":{
        "epoch":1669225617,
        "epochString":"Wed Nov 23 17:46:57 2022\n"
      },
      "afi":"IPv6",
      "safi":"unicast",
      "outRouteMap":"MY_ORIGIN_ASPATH_ONLY",
      "minRouteAdvInt":0,
      "subGroup":[
        {
          "subGroupId":2,
          "groupCreateTime":{
            "epoch":1669225617,
            "epochString":"Wed Nov 23 17:46:57 2022\n"
          },
          "statistics":{
            "joinEvents":2,
            "pruneEvents":0,
            "mergeEvents":0,
            "splitEvents":0,
            "switchEvents":0,
            "peerRefreshEvents":0,
            "mergeCheckEvents":2
          },
          "coalesceTime":1100,
          "version":12,
          "packetQueueInfo":{
            "qeueueLen":0,
            "queuedTotal":1,
            "queueHwmLen":1,
            "totalEnqueued":1
          },
          "adjListCount":1,
          "needsRefresh":false,
          "peers":[
            "uplink_1",
            "uplink_2"
          ]
        }
      ]
    }
  }
}
{
  "sym_3":{
  }
}
{
  "sym_5":{
  }
}
{
  "sym_2":{
  }
}
{
  "sym_4":{
  }
}
{
  "sym_1":{
  }
}

Co-authored-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Ashwini Reddy <ashred@nvidia.com>
19 months agoMerge pull request #12377 from opensourcerouting/fix/enable_scripting
Mark Stapp [Wed, 23 Nov 2022 20:53:50 +0000 (15:53 -0500)]
Merge pull request #12377 from opensourcerouting/fix/enable_scripting

zebra: Replace TC definitions for dplane

19 months agoMerge pull request #12260 from opensourcerouting/pim-plist-masklen
mobash-rasool [Wed, 23 Nov 2022 18:02:17 +0000 (23:32 +0530)]
Merge pull request #12260 from opensourcerouting/pim-plist-masklen

pimd: consistently ignore prefix list mask len

19 months agozebra: Replace TC definitions for dplane
Donatas Abraitis [Wed, 23 Nov 2022 15:35:33 +0000 (17:35 +0200)]
zebra: Replace TC definitions for dplane

They were replaced, but forgot for `--enable-scripting`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodoc: Adding a description for a new option
Michal Ruprich [Tue, 22 Nov 2022 13:27:18 +0000 (14:27 +0100)]
doc: Adding a description for a new option

Documentation for FRR_NO_ROOT option added to the
/etc/frr/daemons file

Signed-off-by: Michal Ruprich <mruprich@redhat.com>
19 months agotools: Enable start of FRR for non-root user
Michal Ruprich [Tue, 22 Nov 2022 11:38:05 +0000 (12:38 +0100)]
tools: Enable start of FRR for non-root user

There might be use cases when this would make sense, for example
running FRR in a container as a designated user.

Signed-off-by: Michal Ruprich <mruprich@redhat.com>
19 months agoMerge pull request #12355 from mobash-rasool/pim6-conformance
Donatas Abraitis [Wed, 23 Nov 2022 09:07:05 +0000 (11:07 +0200)]
Merge pull request #12355 from mobash-rasool/pim6-conformance

pim6d, pimd: RFC conformance - Discard join/prune msg when WC bit is set but RPT bit is unset

19 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command output
Abhishek N R [Wed, 16 Nov 2022 08:08:05 +0000 (00:08 -0800)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command output

Before:

R4(config)# do show ipv6 pim nexthop
Number of registered addresses: 6
Address         Interface        Nexthop
---------------------------------------------
3700:1234:1234:1234:1234:1234:1234:1234 ens161           fe80::250:56ff:feb7:d8d5
5101::10        ens224.51        5101::10
3300::5555      ens161           fe80::250:56ff:feb7:d8d5
4400::1         ens161           fe80::250:56ff:feb7:d8d5
1020::10        ens257           1020::10
3000::1         ens192.4010      fe80::250:56ff:feb7:493b
3000::1         ens193.4015      fe80::250:56ff:feb7:b12a

After:

frr# show ipv6 pim nexthop
Number of registered addresses: 2
Address         Interface        Nexthop
---------------------------------------------
105::105        lo               105::105
12::1           ens192           fe80::250:56ff:feb7:38de

Issue: #11246

Signed-off-by: Abhishek N R <abnr@vmware.com>
19 months agolib: disable vrf before terminating interfaces
Stephen Worley [Tue, 22 Nov 2022 22:18:02 +0000 (17:18 -0500)]
lib: disable vrf before terminating interfaces

We must disable the vrf before we start terminating interfaces.

On termination, we free the 'zebra_if' struct from the interface ->info
pointer. We rely on that for subsystems like vxlan for cleanup when
shutting down.

'''
==497406== Invalid read of size 8
==497406==    at 0x47E70A: zebra_evpn_del (zebra_evpn.c:1103)
==497406==    by 0x47F004: zebra_evpn_cleanup_all (zebra_evpn.c:1363)
==497406==    by 0x4F2404: zebra_evpn_vxlan_cleanup_all (zebra_vxlan.c:1158)
==497406==    by 0x4917041: hash_iterate (hash.c:267)
==497406==    by 0x4F25E2: zebra_vxlan_cleanup_tables (zebra_vxlan.c:5676)
==497406==    by 0x4D52EC: zebra_vrf_disable (zebra_vrf.c:209)
==497406==    by 0x49A247F: vrf_disable (vrf.c:340)
==497406==    by 0x49A2521: vrf_delete (vrf.c:245)
==497406==    by 0x49A2E2B: vrf_terminate_single (vrf.c:533)
==497406==    by 0x49A2D8F: vrf_terminate (vrf.c:561)
==497406==    by 0x441240: sigint (main.c:192)
==497406==    by 0x4981F6D: frr_sigevent_process (sigevent.c:130)
==497406==  Address 0x6d68c68 is 200 bytes inside a block of size 272 free'd
==497406==    at 0x48470E4: free (vg_replace_malloc.c:872)
==497406==    by 0x4942CF0: qfree (memory.c:141)
==497406==    by 0x49196A9: if_delete (if.c:293)
==497406==    by 0x491C54C: if_terminate (if.c:1031)
==497406==    by 0x49A2E22: vrf_terminate_single (vrf.c:532)
==497406==    by 0x49A2D8F: vrf_terminate (vrf.c:561)
==497406==    by 0x441240: sigint (main.c:192)
==497406==    by 0x4981F6D: frr_sigevent_process (sigevent.c:130)
==497406==    by 0x499A5F0: thread_fetch (thread.c:1775)
==497406==    by 0x492850E: frr_run (libfrr.c:1197)
==497406==    by 0x441746: main (main.c:476)
==497406==  Block was alloc'd at
==497406==    at 0x4849464: calloc (vg_replace_malloc.c:1328)
==497406==    by 0x49429A5: qcalloc (memory.c:116)
==497406==    by 0x491D971: if_new (if.c:174)
==497406==    by 0x491ACC8: if_create_name (if.c:228)
==497406==    by 0x491ABEB: if_get_by_name (if.c:613)
==497406==    by 0x427052: netlink_interface (if_netlink.c:1178)
==497406==    by 0x43BC18: netlink_parse_info (kernel_netlink.c:1188)
==497406==    by 0x4266D7: interface_lookup_netlink (if_netlink.c:1288)
==497406==    by 0x42B634: interface_list (if_netlink.c:2368)
==497406==    by 0x4ABF83: zebra_ns_enable (zebra_ns.c:127)
==497406==    by 0x4AC17E: zebra_ns_init (zebra_ns.c:216)
==497406==    by 0x44166C: main (main.c:408)
'''

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agoMerge pull request #12311 from opensourcerouting/feature/bgp_snmp_bgp4v2-mib
Russ White [Tue, 22 Nov 2022 19:58:22 +0000 (14:58 -0500)]
Merge pull request #12311 from opensourcerouting/feature/bgp_snmp_bgp4v2-mib

bgpd: Implement SNMP BGP4V2-MIB (bgp4V2PeerEntry)

19 months agoMerge pull request #11908 from sigeryang/tc-state-mgmt
Stephen Worley [Tue, 22 Nov 2022 17:02:15 +0000 (12:02 -0500)]
Merge pull request #11908 from sigeryang/tc-state-mgmt

zebra: traffic control state management & ZAPI

19 months agoMerge pull request #12340 from opensourcerouting/fix/rfc5549_vpn_set_ip_nexthop
Stephen Worley [Tue, 22 Nov 2022 16:41:48 +0000 (11:41 -0500)]
Merge pull request #12340 from opensourcerouting/fix/rfc5549_vpn_set_ip_nexthop

bgpd: Allow overriding MPLS VPN next-hops via route-maps

19 months agotests: traffic control PoC topotests
Siger Yang [Sun, 11 Sep 2022 06:58:11 +0000 (14:58 +0800)]
tests: traffic control PoC topotests

This commit adds a basic test for sharpd traffic control PoC, which will check
interface TC info from iproute2 `tc` cli.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
19 months agosharpd: traffic control PoC
Siger Yang [Sun, 11 Sep 2022 06:56:12 +0000 (14:56 +0800)]
sharpd: traffic control PoC

This commit adds a command to sharpd to validate the proof of concept for
traffic control on specific interface with specific filters.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
19 months agozebra: traffic control ZAPI
Siger Yang [Tue, 6 Sep 2022 07:13:23 +0000 (15:13 +0800)]
zebra: traffic control ZAPI

This commit adds ZAPI encoders & decoders for traffic control operations, which
include tc_qdisc, tc_class and tc_filter.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
19 months agozebra: traffic control state management
Siger Yang [Tue, 6 Sep 2022 07:10:11 +0000 (15:10 +0800)]
zebra: traffic control state management

This allows Zebra to manage QDISC, TCLASS, TFILTER in kernel and do cleaning
jobs when it starts up.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
19 months agozebra: update tc netlink / socket license header
Siger Yang [Thu, 15 Sep 2022 23:04:39 +0000 (07:04 +0800)]
zebra: update tc netlink / socket license header

Update license header.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
19 months agoinclude: add pkt_cls.h to automake headers
Siger Yang [Tue, 6 Sep 2022 07:07:35 +0000 (15:07 +0800)]
include: add pkt_cls.h to automake headers

Add pkt_cls.h to subdir.am under include.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
19 months agobgpd: Fix the other of SR locator parameters
Ryoga Saito [Tue, 22 Nov 2022 13:57:24 +0000 (22:57 +0900)]
bgpd: Fix the other of SR locator parameters

The latest FRR's frr-reload.py is broken and we can't reload FRR
gracefully with segment routing locator configuration (if we
execute frr-reload.py, FRR will stop suddenly).

The root cause of this issue is very simple. FRR will display the
current configuration like this (the below is the result of
"show running-configuration").

``
segment-routing
 srv6
  locators
   locator default
    prefix fd00:1:0:1::/64 block-len 40 node-len 24 func-bits 16
   exit
   !
  exit
  !
 exit
 !
exit
```

However, FRR doesn't accept segment routing locator parameters
if we specify block-len and node-len earlier than func-bits.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
19 months agobgpd: Fix crash for `set ipv4/ipv6 vpn next-hop` command
Donatas Abraitis [Tue, 22 Nov 2022 12:50:09 +0000 (14:50 +0200)]
bgpd: Fix crash for `set ipv4/ipv6 vpn next-hop` command

Crash when using for example:

```
route-map test permit 10
 set ipv6 vpn next-hop 10.10.10.10
```

```
bgpd[30843]: libyang: Unsatisfied pattern - "1.1.1.1" does not conform to "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?". (Schema location /frr-route-map:lib/route-map/entry/set-action/rmap-set-action/set-action/frr-bgp-route-map:ipv6-address/ipv6-address.)
bgpd[30843]: [JEA2K-29RPH][EC 100663345] nb_candidate_edit: lyd_new_path(/frr-route-map:lib/route-map[name='belekas']/entry[sequence='109']/set-action[action='frr-bgp-route-map:ipv6-vpn-address']/rmap-set-action/frr-bgp-route-map:ipv6-address) failed: 7
bgpd[30843]: [ZDEA9-V1X7W][EC 100663341] nb_cli_apply_changes_internal: failed to edit candidate configuration: operation [modify] xpath [/frr-route-map:lib/route-map[name='belekas']/entry[sequence='109']/set-action[action='frr-bgp-route-map:ipv6-vpn-address']/rmap-set-action/frr-bgp-route-map:ipv6-address]
bgpd[30843]: [SZNR8-V24R3][EC 100663326] yang_dnode_xpath_get_canon: couldn't find ./rmap-set-action/frr-bgp-route-map:ipv6-address
bgpd[30843]: Backtrace for 20 stack frames:
bgpd[30843]: [bt 0] /usr/local/lib/libfrr.so.0(zlog_backtrace+0x3a) [0x7f539c87c95a]
bgpd[30843]: [bt 1] /usr/local/lib/libfrr.so.0(+0xed022) [0x7f539c8c8022]
bgpd[30843]: [bt 2] /usr/local/lib/libfrr.so.0(yang_dnode_get_string+0x96) [0x7f539c8c9ea6]
bgpd[30843]: [bt 3] /usr/local/lib/libfrr.so.0(route_map_action_show+0xc40) [0x7f539c8a4540]
bgpd[30843]: [bt 4] /usr/local/lib/libfrr.so.0(nb_cli_show_dnode_cmds+0x5c) [0x7f539c88fa8c]
bgpd[30843]: [bt 5] /usr/local/lib/libfrr.so.0(nb_cli_show_dnode_cmds+0x159) [0x7f539c88fb89]
bgpd[30843]: [bt 6] /usr/local/lib/libfrr.so.0(nb_cli_show_dnode_cmds+0x1a3) [0x7f539c88fbd3]
bgpd[30843]: [bt 7] /usr/local/lib/libfrr.so.0(nb_cli_show_dnode_cmds+0x159) [0x7f539c88fb89]
bgpd[30843]: [bt 8] /usr/local/lib/libfrr.so.0(+0xc4d47) [0x7f539c89fd47]
bgpd[30843]: [bt 9] /usr/local/lib/libfrr.so.0(+0x7274a) [0x7f539c84d74a]
bgpd[30843]: [bt 10] /usr/local/lib/libfrr.so.0(+0x72cb0) [0x7f539c84dcb0]
bgpd[30843]: [bt 11] /usr/local/lib/libfrr.so.0(+0x74c40) [0x7f539c84fc40]
bgpd[30843]: [bt 12] /usr/local/lib/libfrr.so.0(cmd_execute_command+0xa4) [0x7f539c84fd74]
bgpd[30843]: [bt 13] /usr/local/lib/libfrr.so.0(cmd_execute+0x142) [0x7f539c84ffe2]
bgpd[30843]: [bt 14] /usr/local/lib/libfrr.so.0(+0xe51b7) [0x7f539c8c01b7]
bgpd[30843]: [bt 15] /usr/local/lib/libfrr.so.0(+0xe53f0) [0x7f539c8c03f0]
bgpd[30843]: [bt 16] /usr/local/lib/libfrr.so.0(+0xe8078) [0x7f539c8c3078]
bgpd[30843]: [bt 17] /usr/local/lib/libfrr.so.0(thread_call+0x7d) [0x7f539c8bacbd]
bgpd[30843]: [bt 18] /usr/local/lib/libfrr.so.0(frr_run+0xe8) [0x7f539c8749b8]
bgpd[30843]: [bt 19] /usr/lib/frr/bgpd(main+0x3f1) [0x55f887e97d71]
BGP[30843]: Received signal 6 at 1669121170 (si_addr 0x7f0000787b, PC 0x7f539ba58e87); aborting...
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotests: Set minimum wait time for tests to 5 seconds
Donatas Abraitis [Tue, 22 Nov 2022 09:17:27 +0000 (11:17 +0200)]
tests: Set minimum wait time for tests to 5 seconds

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoospfd: Fixing memleak.
rgirada [Tue, 22 Nov 2022 09:59:40 +0000 (09:59 +0000)]
ospfd: Fixing memleak.

Description:
As part of signal handler ospf_finish_final(),  lsas are originated
and added to refresh queues are not freed.

One such leak is :
==2869285== 432 (40 direct, 392 indirect) bytes in 1 blocks are definitely lost in loss record 159 of 221
==2869285==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2869285==    by 0x4910EC3: qcalloc (memory.c:116)
==2869285==    by 0x199024: ospf_refresher_register_lsa (ospf_lsa.c:4017)
==2869285==    by 0x199024: ospf_refresher_register_lsa (ospf_lsa.c:3979)
==2869285==    by 0x19A37F: ospf_network_lsa_install (ospf_lsa.c:2680)
==2869285==    by 0x19A37F: ospf_lsa_install (ospf_lsa.c:2941)
==2869285==    by 0x19C18F: ospf_network_lsa_update (ospf_lsa.c:1099)
==2869285==    by 0x1931ED: ism_change_state (ospf_ism.c:556)
==2869285==    by 0x1931ED: ospf_ism_event (ospf_ism.c:596)
==2869285==    by 0x494E0B0: thread_call (thread.c:2006)
==2869285==    by 0x494E395: _thread_execute (thread.c:2098)
==2869285==    by 0x19FBC6: nsm_change_state (ospf_nsm.c:695)
==2869285==    by 0x19FBC6: ospf_nsm_event (ospf_nsm.c:861)
==2869285==    by 0x494E0B0: thread_call (thread.c:2006)
==2869285==    by 0x494E395: _thread_execute (thread.c:2098)
==2869285==    by 0x19020B: ospf_if_cleanup (ospf_interface.c:322)
==2869285==    by 0x192D0C: ism_interface_down (ospf_ism.c:393)
==2869285==    by 0x193028: ospf_ism_event (ospf_ism.c:584)
==2869285==    by 0x494E0B0: thread_call (thread.c:2006)
==2869285==    by 0x494E395: _thread_execute (thread.c:2098)
==2869285==    by 0x190F10: ospf_if_down (ospf_interface.c:851)
==2869285==    by 0x1911D6: ospf_if_free (ospf_interface.c:341)
==2869285==    by 0x1E6E98: ospf_finish_final (ospfd.c:748)
==2869285==    by 0x1E6E98: ospf_deferred_shutdown_finish (ospfd.c:578)
==2869285==    by 0x1E7727: ospf_finish (ospfd.c:682)
==2869285==    by 0x1E7727: ospf_terminate (ospfd.c:652)
==2869285==    by 0x18852B: sigint (ospf_main.c:105)
==2869285==    by 0x493BE12: frr_sigevent_process (sigevent.c:130)
==2869285==    by 0x494DCD4: thread_fetch (thread.c:1775)
==2869285==    by 0x4905022: frr_run (libfrr.c:1197)
==2869285==    by 0x187891: main (ospf_main.c:235)

Added a fix to cleanup all these queue pointers and corresponing lsas in it.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
19 months agotests: Fail tests immediately if they use too low wait/count values
Donatas Abraitis [Fri, 18 Nov 2022 15:22:46 +0000 (17:22 +0200)]
tests: Fail tests immediately if they use too low wait/count values

This is for run_and_expect_type and run_and_expect topotests method.

Some contributions unintentionally get merged with very low values, that leads
to CI failures, let's guard this a bit.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agopim6d, pimd: Discard (*,G) prune if WC bit is set but RPT bit is unset.
Mobashshera Rasool [Mon, 21 Nov 2022 11:15:28 +0000 (03:15 -0800)]
pim6d, pimd: Discard (*,G) prune if WC bit is set but RPT bit is unset.

As per RFC 7761, Section 4.9.1
The RPT (or Rendezvous Point Tree) bit is a 1-bit value for use
with PIM Join/Prune messages (see Section 4.9.5.1). If the
WC bit is 1, the RPT bit MUST be 1.

ANVL conformance test case is trying to verify this and is failing.

Issue: #12354

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
19 months agopim6d, pimd: Discard (*,G) join if WC bit is set but RPT bit is unset.
Mobashshera Rasool [Mon, 21 Nov 2022 11:10:02 +0000 (03:10 -0800)]
pim6d, pimd: Discard (*,G) join if WC bit is set but RPT bit is unset.

As per RFC 7761, Section 4.9.1
The RPT (or Rendezvous Point Tree) bit is a 1-bit value for use
with PIM Join/Prune messages (see Section 4.9.5.1). If the
WC bit is 1, the RPT bit MUST be 1.

ANVL conformance test case is trying to verify this and is failing.

Issue: #12354

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
19 months agoMerge pull request #12348 from donaldsharp/expand_timings
Donatas Abraitis [Tue, 22 Nov 2022 05:43:49 +0000 (07:43 +0200)]
Merge pull request #12348 from donaldsharp/expand_timings

tests: Expand minimum run_and_expect to 5 seconds

19 months agoMerge pull request #12361 from opensourcerouting/fix/use_another_labaler
Donald Sharp [Tue, 22 Nov 2022 01:07:46 +0000 (20:07 -0500)]
Merge pull request #12361 from opensourcerouting/fix/use_another_labaler

github: Use `action-regex-match` action for adding `backport` label