]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 years agolib: Hide list macros in linklist.c
Donald Sharp [Fri, 9 Dec 2022 13:37:45 +0000 (08:37 -0500)]
lib: Hide list macros in linklist.c

The LISTNODE_ATTACH|DELETE macros are only used in
linklist.c.  Let's remove temptation from people
to use them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit b3faf1aab6029caf272475122fd99f7f0b0b39c9)

2 years agoospf6d: Don't allocate json memory in non-json path
Donald Sharp [Fri, 9 Dec 2022 13:32:12 +0000 (08:32 -0500)]
ospf6d: Don't allocate json memory in non-json path

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 21c6569d6f4dca71b4ddf7e6499e296efaf819c0)

2 years agozebra: Actually free all memory associated ctx->u.iptable.interface_name_list
Donald Sharp [Fri, 9 Dec 2022 13:14:31 +0000 (08:14 -0500)]
zebra: Actually free all memory associated ctx->u.iptable.interface_name_list

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 1cc380679e4cbca5c0c4259653c57da1f47dbafe)

2 years agoisisd: Fix sadj memory leak
Donald Sharp [Fri, 9 Dec 2022 12:44:26 +0000 (07:44 -0500)]
isisd: Fix sadj memory leak

In some cases the sadj was directly dropped.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 63e6e11f9f8a5e60fc9f6aaf54d33ba04cc3a6b4)

2 years agoMerge pull request #12428 from FRRouting/mergify/bp/stable/8.4/pr-12427
Donatas Abraitis [Fri, 2 Dec 2022 08:43:20 +0000 (10:43 +0200)]
Merge pull request #12428 from FRRouting/mergify/bp/stable/8.4/pr-12427

build: enable pim6d by default (backport #12427)

2 years agobuild: enable pim6d by default 12428/head
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>
(cherry picked from commit cee45b84f4648750cdfae314cca7b91ee3a696a2)

2 years agoMerge pull request #12419 from FRRouting/mergify/bp/stable/8.4/pr-12386
Donatas Abraitis [Tue, 29 Nov 2022 19:32:49 +0000 (21:32 +0200)]
Merge pull request #12419 from FRRouting/mergify/bp/stable/8.4/pr-12386

bfdd: fix IPv4 socket source selection (backport #12386)

2 years agoMerge pull request #12420 from FRRouting/mergify/bp/stable/8.4/pr-12367
Donatas Abraitis [Tue, 29 Nov 2022 19:32:34 +0000 (21:32 +0200)]
Merge pull request #12420 from FRRouting/mergify/bp/stable/8.4/pr-12367

ospfd: Fixing a memleak. (backport #12367)

2 years agoospfd: Fixing memleak. 12420/head
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>
(cherry picked from commit 594f80c83f40935b6dfcd15c8a3c28f1b4e3d423)

2 years agobfdd: fix IPv4 socket source selection 12419/head
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>
(cherry picked from commit f68114c1c397a939fd758af072c37d535f1de92f)

2 years agoMerge pull request #12411 from FRRouting/mergify/bp/stable/8.4/pr-12408
Donatas Abraitis [Mon, 28 Nov 2022 19:00:58 +0000 (21:00 +0200)]
Merge pull request #12411 from FRRouting/mergify/bp/stable/8.4/pr-12408

zebra: Use `mpls enable`, not `mpls` when generating a config (backport #12408)

2 years agoMerge pull request #12412 from FRRouting/mergify/bp/stable/8.4/pr-12389
Donatas Abraitis [Mon, 28 Nov 2022 19:00:49 +0000 (21:00 +0200)]
Merge pull request #12412 from FRRouting/mergify/bp/stable/8.4/pr-12389

ospf6d: fix infinite loop when adding ASBR route (backport #12389)

2 years agoospf6d: fix infinite loop when adding ASBR route 12412/head
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>
(cherry picked from commit 4dfe15200ab1a84a8d77fcbc33085c373d556eae)

2 years agozebra: Use `mpls enable`, not `mpls` when generating a config 12411/head
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>
(cherry picked from commit 35c46a8718948850f67ec6c3ec00551b2b839310)

2 years agoMerge pull request #12407 from FRRouting/mergify/bp/stable/8.4/pr-12403
Donatas Abraitis [Mon, 28 Nov 2022 10:39:12 +0000 (12:39 +0200)]
Merge pull request #12407 from FRRouting/mergify/bp/stable/8.4/pr-12403

Echo exclusion (backport #12403)

2 years agolib: Do not log `echo PING` commands from watchfrr 12407/head
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>
(cherry picked from commit a8a0f80b634208c878e15335948810e1d532d1e7)

2 years 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>
(cherry picked from commit bcb486dd3cbce01dd1d9085006305cfcd738f9e8)

2 years agoMerge pull request #12404 from FRRouting/mergify/bp/stable/8.4/pr-12399
Donatas Abraitis [Sun, 27 Nov 2022 14:50:33 +0000 (16:50 +0200)]
Merge pull request #12404 from FRRouting/mergify/bp/stable/8.4/pr-12399

staticd: Fix crash for an existing route with color (backport #12399)

2 years agostaticd: Do not crash when modifying an existing static route with color 12404/head
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>
(cherry picked from commit 3278956b1741e9af38b92d74f84a8e48b1b6943e)

2 years agoMerge pull request #12400 from FRRouting/mergify/bp/stable/8.4/pr-12370
Donatas Abraitis [Sat, 26 Nov 2022 19:19:06 +0000 (21:19 +0200)]
Merge pull request #12400 from FRRouting/mergify/bp/stable/8.4/pr-12370

bgpd: Fix crash for `set ipv4/ipv6 vpn next-hop` command (backport #12370)

2 years agobgpd: Fix crash for `set ipv4/ipv6 vpn next-hop` command 12400/head
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>
(cherry picked from commit 7be9666f9a1aeda292694fc936394977ada65724)

2 years agoMerge pull request #12382 from FRRouting/mergify/bp/stable/8.4/pr-12374
Donatas Abraitis [Fri, 25 Nov 2022 06:55:15 +0000 (08:55 +0200)]
Merge pull request #12382 from FRRouting/mergify/bp/stable/8.4/pr-12374

lib: disable vrf before terminating interfaces (backport #12374)

2 years agoMerge pull request #12387 from FRRouting/mergify/bp/stable/8.4/pr-12317
Donatas Abraitis [Fri, 25 Nov 2022 06:55:06 +0000 (08:55 +0200)]
Merge pull request #12387 from FRRouting/mergify/bp/stable/8.4/pr-12317

ospfd: Fix RFC conformance test cases 25.19 and 27.6 (backport #12317)

2 years agoospfd: Fix RFC conformance test cases 25.19 and 27.6 12387/head
Mobashshera Rasool [Tue, 15 Nov 2022 05:00:55 +0000 (21:00 -0800)]
ospfd: Fix RFC conformance test cases 25.19 and 27.6

Steps to reproduce:
--------------------------
1. ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0 with DUT as DR.
2. ANVL: Listen (for up to 2 * <RxmtInterval> seconds) on DIface-0.
3. DUT: Send <OSPF-LSU> packet.
4. ANVL: Verify that the received <OSPF-LSU> packet contains a Network- LSA for network N1
   originated by DUT, and the LS Sequence Number is set to <InitialSequenceNumber>.
5. ANVL: Establish full adjacency with DUT for neighbor Rtr-0-B on DIface-0 with DUT as DR.
6. ANVL: Listen (for up to 2 * <RxmtInterval> seconds) on DIface-0.
7. DUT: Send <OSPF-LSU> packet.
8. ANVL: Verify that the received <OSPF-LSU> packet contains a new instance of the
   Network-LSA for network N1 originated by DUT, and the LS Sequence Number
   is set to (<InitialSequenceNumber> + 1).

Both the test cases were failing while verifying the initial sequence number for network LSA.

This is because currently OSPF does not reset its LSA sequence number when it is going down.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit ca5997cd018ec66534285130d02de168a3a4ed5c)

2 years agolib: disable vrf before terminating interfaces 12382/head
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>
(cherry picked from commit b14fa9c4dca1846d64ced5a9710faa1345da4ca0)

2 years agoMerge pull request #12381 from FRRouting/mergify/bp/stable/8.4/pr-12377
Donatas Abraitis [Thu, 24 Nov 2022 07:13:07 +0000 (09:13 +0200)]
Merge pull request #12381 from FRRouting/mergify/bp/stable/8.4/pr-12377

zebra: Replace TC definitions for dplane (backport #12377)

2 years agoMerge pull request #12378 from FRRouting/mergify/bp/stable/8.4/pr-12260
mobash-rasool [Thu, 24 Nov 2022 05:26:32 +0000 (10:56 +0530)]
Merge pull request #12378 from FRRouting/mergify/bp/stable/8.4/pr-12260

pimd: consistently ignore prefix list mask len (backport #12260)

2 years agozebra: Replace TC definitions for dplane 12381/head
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>
(cherry picked from commit 2272627571681ba01585fc3f25a3ebfda1b7da30)

2 years agopimd: consistently ignore prefix list mask len 12378/head
David Lamparter [Fri, 4 Nov 2022 15:55:55 +0000 (16:55 +0100)]
pimd: consistently ignore prefix list mask len

... the prefix length wasn't ignored as expected.  Both S and G are
always /32.  But expecting "le 32" in prefix-list config is unexpected &
counterintuitive.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ab2f9e89b44642af568c3542e1f2b14378fb5ec2)

2 years agoMerge pull request #12360 from FRRouting/mergify/bp/stable/8.4/pr-12347
Jafar Al-Gharaibeh [Tue, 22 Nov 2022 16:31:01 +0000 (10:31 -0600)]
Merge pull request #12360 from FRRouting/mergify/bp/stable/8.4/pr-12347

snapcraft: Add pim6 daemon for PIM IPv6 to snap package (backport #12347)

2 years agosnapcraft: Add pim6 daemon for PIM IPv6 to snap package 12360/head
Martin Winter [Sat, 19 Nov 2022 11:15:41 +0000 (12:15 +0100)]
snapcraft: Add pim6 daemon for PIM IPv6 to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit feeaf30fde211fcff4231807fc9e52c4bbd3000e)

2 years agoFRR Release 8.4.1 docker/8.4.1 frr-8.4.1
Jafar Al-Gharaibeh [Fri, 18 Nov 2022 05:09:28 +0000 (23:09 -0600)]
FRR Release 8.4.1

- zebra: reuse netinet/if_ether.h to avoid redefinition of struct ethhdr
- zebra: fix build without AF_MPLS
- ospfd: get route-map name for default-information originate
- ospfd: allow unnumbered and numbered addresses to co-exist better
- ospfd: prevent from crashing when processing external lsa
- bgpd: fix "storing the address of local variable"
- bgpd: rpki was decrementing the node lock one time too many
- bgpd: do not send Deconfig/Shutdown message when restarting
- pimd: convert zlog_warn to debug

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #12332 from FRRouting/mergify/bp/stable/8.4/pr-12309
Donatas Abraitis [Thu, 17 Nov 2022 20:21:43 +0000 (22:21 +0200)]
Merge pull request #12332 from FRRouting/mergify/bp/stable/8.4/pr-12309

bgpd: fix invalid ipv4-vpn nexthop for IPv6 peer (backport #12309)

2 years agobgpd: fix invalid ipv4-vpn nexthop for IPv6 peer 12332/head
Ryoga Saito [Sat, 12 Nov 2022 08:45:19 +0000 (17:45 +0900)]
bgpd: fix invalid ipv4-vpn nexthop for IPv6 peer

Given that two routers are connected each other and they have IPv6
addresses and they establish BGP peer with extended-nexthop capability
and one router tries to advertise locally-generated IPv4-VPN routes to
other router.

In this situation, bgpd on the router that tries to advertise IPv4-VPN
routes will be crashed with "invalid MP nexthop length (AFI IP6)".

This issue is happened because MP_REACH_NLRI path attribute is not
generated correctly when ipv4-vpn routes are advertised to IPv6 peer.
When IPv4 routes are leaked from VRF RIB, the nexthop of these routes
are also IPv4 address (0.0.0.0/0 or specific addresses). However,
bgp_packet_mpattr_start only covers the case of IPv6 nexthop (for IPv6
peer).

ipv4-unicast routes were not affected by this issue because the case of
IPv4 nexthop is covered in `else` block.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
(cherry picked from commit 63e7ddb509435d9e178cf51a9a288273fb91bf7e)

2 years agotests: Add topotest for l3vpn over ipv6 peer
Ryoga Saito [Wed, 16 Nov 2022 23:37:55 +0000 (08:37 +0900)]
tests: Add topotest for l3vpn over ipv6 peer

To check the effect of the next patch, I added topotest.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
(cherry picked from commit 3db8aa8750d1be675f6df1ed765afeb101b6402b)

2 years agoMerge pull request #12331 from FRRouting/mergify/bp/stable/8.4/pr-12302
Donatas Abraitis [Thu, 17 Nov 2022 14:42:01 +0000 (16:42 +0200)]
Merge pull request #12331 from FRRouting/mergify/bp/stable/8.4/pr-12302

isisd: fix area NULL pointer in isis_route_update (backport #12302)

2 years agoMerge pull request #12330 from FRRouting/mergify/bp/stable/8.4/pr-12312
Donatas Abraitis [Thu, 17 Nov 2022 12:14:58 +0000 (14:14 +0200)]
Merge pull request #12330 from FRRouting/mergify/bp/stable/8.4/pr-12312

bgpd: authorise to select bgp self peer prefix on rr case (backport #12312)

2 years agoisisd: fix area NULL pointer in isis_route_update 12331/head
Louis Scalbert [Thu, 10 Nov 2022 16:18:01 +0000 (17:18 +0100)]
isisd: fix area NULL pointer in isis_route_update

Fix the case area is NULL.

Fixes: acc0029779 ("isisd: fix potential access to NULL pointer in isis_route_update")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 41c2bf853f072008330a929480bf235ac840212a)

2 years agobgpd: authorise to select bgp self peer prefix on rr case 12330/head
Philippe Guibert [Mon, 7 Nov 2022 10:56:37 +0000 (11:56 +0100)]
bgpd: authorise to select bgp self peer prefix on rr case

This commit addresses an issue that happens when using bgp
peering with a rr client, with a received prefix which is the
local ip address of the bgp session.

When using bgp ipv4 unicast session, the local prefix is
received by a peer, and finds out that the proposed prefix
and its next-hop are the same. To avoid a route loop locally,
no nexthop entry is referenced for that prefix, and the route
will not be selected.

When the received peer is a route reflector, the prefix has
to be selected, even if the route can not be installed locally.

Fixes: ("fb8ae704615c") bgpd: prevent routes loop through itself
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit f874552557cf2577ae91b297f422e307084f22d3)

2 years agoMerge pull request #12320 from FRRouting/mergify/bp/stable/8.4/pr-12307
Donatas Abraitis [Tue, 15 Nov 2022 16:02:43 +0000 (18:02 +0200)]
Merge pull request #12320 from FRRouting/mergify/bp/stable/8.4/pr-12307

tools: remove backslash from declare check regex (backport #12307)

2 years agoMerge pull request #12319 from FRRouting/mergify/bp/stable/8.4/pr-12315
Donatas Abraitis [Tue, 15 Nov 2022 09:28:25 +0000 (11:28 +0200)]
Merge pull request #12319 from FRRouting/mergify/bp/stable/8.4/pr-12315

Dplane sorry (backport #12315)

2 years agotools: remove backslash from declare check regex 12320/head
Marius Tomaschewski [Fri, 11 Nov 2022 11:26:04 +0000 (12:26 +0100)]
tools: remove backslash from declare check regex

The backslash in `grep -q '^declare \-a'` is not needed and
causes `grep: warning: stray \ before -` warning in grep-3.8.

Signed-off-by: Marius Tomaschewski <mt@suse.com>
(cherry picked from commit 5216a05b32390a64efeb598051411e1776042624)

2 years agozebra: Fix dplane_fpm_nl to allow for fast configuration 12319/head
Donald Sharp [Mon, 14 Nov 2022 13:28:45 +0000 (08:28 -0500)]
zebra: Fix dplane_fpm_nl to allow for fast configuration

If you have this order in your configuration file:

no fpm use-next-hop-groups
fpm address 127.0.0.1

the dplane code was using the same event thread t_event and the second
add event in the code was going, you already have an event scheduled
and as such the second event does not overwrite it.  Leaving
no code to actually start the whole processing.  There are probably
other cli iterations that will cause this fun as well, but I'm
not going to spend the time sussing them out at the moment.

Fixes: #12314
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 551fa8c3549e24020dfce33d06ade4a14f72abfe)

2 years agozebra: Use the enum, luke
Donald Sharp [Mon, 14 Nov 2022 13:06:16 +0000 (08:06 -0500)]
zebra: Use the enum, luke

Use the enum and let the compiler help us figure out
what cases are being missed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit dc31de93e1a79b4a138b474d3c4fdb44cdfee6f3)

2 years agoMerge pull request #12305 from FRRouting/mergify/bp/stable/8.4/pr-12303
Donatas Abraitis [Fri, 11 Nov 2022 08:47:46 +0000 (10:47 +0200)]
Merge pull request #12305 from FRRouting/mergify/bp/stable/8.4/pr-12303

zebra: relax if_type check to allow early ES config creation (backport #12303)

2 years agozebra: relax if_type check to allow early ES config creation 12305/head
Anuradha Karuppiah [Fri, 29 May 2020 16:53:31 +0000 (09:53 -0700)]
zebra: relax if_type check to allow early ES config creation

The API for configuring ES in zebra had a strict check for if_type
"isBond" that prevented the ES config from being created before the
interface.

Ticket: CM-29454

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
(cherry picked from commit 3fa177eed287823bbe1d6c7bd9856d1d19435db3)

2 years agoMerge pull request #12304 from FRRouting/mergify/bp/stable/8.4/pr-12269
Jafar Al-Gharaibeh [Thu, 10 Nov 2022 22:20:57 +0000 (16:20 -0600)]
Merge pull request #12304 from FRRouting/mergify/bp/stable/8.4/pr-12269

ospfd: prevent from crashing when processing external lsa (backport #12269)

2 years agoospfd: prevent from crashing when processing external lsa 12304/head
Philippe Guibert [Mon, 7 Nov 2022 10:03:41 +0000 (11:03 +0100)]
ospfd: prevent from crashing when processing external lsa

When using debug mode, the ei parameter may be NULL. In that
case, do not display the log trace, otherwise a crash will
happen.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit e5309c1a6e366f5dc95cbc3bbbe5c7ce1d46625c)

2 years agoMerge pull request #12299 from FRRouting/mergify/bp/stable/8.4/pr-12297
Jafar Al-Gharaibeh [Thu, 10 Nov 2022 04:55:42 +0000 (22:55 -0600)]
Merge pull request #12299 from FRRouting/mergify/bp/stable/8.4/pr-12297

pimd: Convert zlog_warn to debug (backport #12297)

2 years agopimd: Convert zlog_warn to debug 12299/head
Donald Sharp [Fri, 22 Nov 2019 20:12:05 +0000 (15:12 -0500)]
pimd: Convert zlog_warn to debug

The unable to find a nexthop should not be a warning it should
be a debug.  Switching over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 7d7206a534eec49b83ff0ef95fe1ba04e5507fc8)

2 years agoMerge pull request #12293 from donaldsharp/rpki_crash_to_8.4
Donatas Abraitis [Wed, 9 Nov 2022 14:46:50 +0000 (16:46 +0200)]
Merge pull request #12293 from donaldsharp/rpki_crash_to_8.4

bgpd: rpki was decrementing the node lock one time too many

2 years agobgpd: rpki was decrementing the node lock one time too many 12293/head
Donald Sharp [Tue, 8 Nov 2022 19:38:02 +0000 (14:38 -0500)]
bgpd: rpki was decrementing the node lock one time too many

The code was this:

1)        match = bgp_table_subtree_lookup(rrp->bgp->rib[rrp->afi][rrp->safi],
                                         &rrp->prefix);

2)        node = match;

        while (node) {
                if (bgp_dest_has_bgp_path_info_data(node)) {
                        revalidate_bgp_node(node, rrp->afi, rrp->safi);
                }

3)               node = bgp_route_next_until(node, match);
        }

if (match)
4)              bgp_dest_unlock_node(match);

At 1) match was locked and became +1
At 2) match and node are now equal
At 3) On first iteration, match is decremented( as that node points
at it ) and the next item is locked, if it is found, and returned which becomes node

If 3 is run again because node is non-null then, current node is decremented
and the next node found is incremented and returned which becomes node again.

So if we get to 4) match is unlocked again which is now a double unlock
which, frankly, is not good.  In all code paths that I can see the
test for `if (match) ...` is not needed so let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12290 from FRRouting/mergify/bp/stable/8.4/pr-12286
Donatas Abraitis [Wed, 9 Nov 2022 09:20:28 +0000 (11:20 +0200)]
Merge pull request #12290 from FRRouting/mergify/bp/stable/8.4/pr-12286

zebra/netconf_netlink.c: fix build without AF_MPLS (backport #12286)

2 years agozebra/netconf_netlink.c: fix build without AF_MPLS 12290/head
Fabrice Fontaine [Tue, 8 Nov 2022 17:48:41 +0000 (18:48 +0100)]
zebra/netconf_netlink.c: fix build without AF_MPLS

Fix the following build failure raised since version 8.4 and
https://github.com/FRRouting/frr/commit/d53dc9bd8164ba40242e2013d382fb01eb0b96ed:

zebra/netconf_netlink.c: In function 'netlink_netconf_change':
zebra/netconf_netlink.c:109:32: error: 'AF_MPLS' undeclared (first use in this function)
  109 |         if (ncm->ncm_family == AF_MPLS)
      |                                ^~~~~~~

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
(cherry picked from commit fa60f2c2fac9ff6d71e8bddab92f78a6d558035b)

2 years agoMerge pull request #12285 from FRRouting/mergify/bp/stable/8.4/pr-12258
Donatas Abraitis [Tue, 8 Nov 2022 19:24:53 +0000 (21:24 +0200)]
Merge pull request #12285 from FRRouting/mergify/bp/stable/8.4/pr-12258

bgpd: fix "storing the address of local variable" (backport #12258)

2 years agobgpd: fix "storing the address of local variable" 12285/head
David Lamparter [Fri, 4 Nov 2022 11:33:28 +0000 (12:33 +0100)]
bgpd: fix "storing the address of local variable"

New GCC 12 warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit c34a7afc743c52e1081f10792047cdf73e9cba2c)

2 years agoMerge pull request #12282 from FRRouting/mergify/bp/stable/8.4/pr-12115
Jafar Al-Gharaibeh [Tue, 8 Nov 2022 16:33:21 +0000 (10:33 -0600)]
Merge pull request #12282 from FRRouting/mergify/bp/stable/8.4/pr-12115

ospfd: Allow unnumbered and numbered addresses to co-exist better (backport #12115)

2 years agoospfd: Allow unnumbered and numbered addresses to co-exist better 12282/head
Donald Sharp [Wed, 12 Oct 2022 20:05:23 +0000 (16:05 -0400)]
ospfd: Allow unnumbered and numbered addresses to co-exist better

When forming a neighbor relationship on an interface, ospf is
currently evaluating unnumbered as highest priority, without
any consideration for if you have /32's and non /32's on the
interface.  Effectively if I have something like this:

int foo0
  ip address 192.168.119.1/24
!
router ospf
  network 0.0.0.0/0 area 0
!

ospf will form a neighbor on foo0 if it exists.  Now
suppose someone does this:

int foo0
  ip address 192.168.120.1/32

This will create the unnumbered interface on foo0 and
the peering will come down immediately.

The problem here is that the original designers of the unnumbered
code for ospf didn't envision end operators mixing and matching
addresses on an interface like this ( for perfectly legitimate
reasons I might add ).

So if ospf has both numbered and unnumbered let's match against
the numbered first and then unnumbered.  This solves the problem

Fixes: #6823
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 5136e6729464c57353be1ad4a55fcbdbbfc7779d)

2 years agoMerge pull request #12275 from FRRouting/mergify/bp/stable/8.4/pr-12034
Donatas Abraitis [Tue, 8 Nov 2022 07:16:10 +0000 (09:16 +0200)]
Merge pull request #12275 from FRRouting/mergify/bp/stable/8.4/pr-12034

bgpd: Do not send Deconfig/Shutdown message when restarting (backport #12034)

2 years agoMerge pull request #12274 from FRRouting/mergify/bp/stable/8.4/pr-12268
Jafar Al-Gharaibeh [Tue, 8 Nov 2022 06:26:03 +0000 (00:26 -0600)]
Merge pull request #12274 from FRRouting/mergify/bp/stable/8.4/pr-12268

zebra: Reuse netinet/if_ether.h to avoid redefinition of struct ethhdr (backport #12268)

2 years agoMerge pull request #12277 from FRRouting/mergify/bp/stable/8.4/pr-12276
Jafar Al-Gharaibeh [Tue, 8 Nov 2022 06:25:34 +0000 (00:25 -0600)]
Merge pull request #12277 from FRRouting/mergify/bp/stable/8.4/pr-12276

ospfd: Get route-map name for default-information originate (backport #12276)

2 years agoospfd: Get route-map name for default-information originate 12277/head
Donatas Abraitis [Mon, 7 Nov 2022 20:23:07 +0000 (22:23 +0200)]
ospfd: Get route-map name for default-information originate

LR1.wue3(config)# route-map foo-bar-baz10 permit 10
LR1.wue3(config-route-map)# exit
LR1.wue3(config)# router ospf
LR1.wue3(config-router)#  ospf router-id 172.18.254.201
LR1.wue3(config-router)#  log-adjacency-changes
LR1.wue3(config-router)# default-information originate metric 50 metric-type 1 route-map foo-bar-baz10
LR1.wue3(config-router)# end

Results in:

LR1.wue3# show run
...
!
router ospf
 ospf router-id 172.18.254.201
 log-adjacency-changes
 default-information originate metric 50 metric-type 1 route-map oute-map
exit
!
route-map foo-bar-baz10 permit 10
exit
!
end

Let's fix this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit bd162aae094360605b7f4b9b8cd46f6e4ffebc04)

2 years agotests: Check if the routes in the kernel are retained for GR as well 12275/head
Donatas Abraitis [Fri, 30 Sep 2022 06:46:00 +0000 (09:46 +0300)]
tests: Check if the routes in the kernel are retained for GR as well

Not only in BGP table.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 18e427bc598879110860fd198808300e991ad146)

2 years agobgpd: Do not send Deconfig/Shutdown message when restarting
Donatas Abraitis [Tue, 27 Sep 2022 14:30:16 +0000 (17:30 +0300)]
bgpd: Do not send Deconfig/Shutdown message when restarting

We might disable sending unconfig/shutdown notifications when
Graceful-Restart is enabled and negotiated.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 95098d9611e79d43b578400bb76dc7a76aa8cab9)

2 years agozebra: Reuse netinet/if_ether.h to avoid redefinition of struct ethhdr 12274/head
Donatas Abraitis [Wed, 2 Nov 2022 21:01:18 +0000 (23:01 +0200)]
zebra: Reuse netinet/if_ether.h to avoid redefinition of struct ethhdr

In file included from /usr/include/net/ethernet.h:10,
                 from ./lib/prefix.h:26,
                 from zebra/tc_netlink.c:32:
/usr/include/netinet/if_ether.h:115:8: error: redefinition of 'struct ethhdr'
  115 | struct ethhdr {
      |        ^~~~~~
In file included from zebra/tc_netlink.c:28:
/usr/include/linux/if_ether.h:169:8: note: originally defined here
  169 | struct ethhdr {
      |        ^~~~~~

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 83f496bdf094d71e9bbe38f08f39426f8b1a139d)

2 years agoFRR Release 8.4 frr-8.4
Jafar Al-Gharaibeh [Thu, 3 Nov 2022 03:45:40 +0000 (22:45 -0500)]
FRR Release 8.4

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agodebian, redhat: updating changelog for new release
Jafar Al-Gharaibeh [Thu, 3 Nov 2022 03:44:56 +0000 (22:44 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #12249 from FRRouting/mergify/bp/stable/8.4/pr-12247
Jafar Al-Gharaibeh [Thu, 3 Nov 2022 03:36:32 +0000 (22:36 -0500)]
Merge pull request #12249 from FRRouting/mergify/bp/stable/8.4/pr-12247

bgpd: Ensure that bgp open message stream has enough data to read (backport #12247)

2 years agobgpd: Ensure that bgp open message stream has enough data to read 12249/head
Donald Sharp [Wed, 2 Nov 2022 17:24:48 +0000 (13:24 -0400)]
bgpd: Ensure that bgp open message stream has enough data to read

If a operator receives an invalid packet that is of insufficient size
then it is possible for BGP to assert during reading of the packet
instead of gracefully resetting the connection with the peer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 766eec1b7accffe2c04a5c9ebb14e9f487bb9f78)

2 years agoMerge pull request #12242 from FRRouting/mergify/bp/dev/8.4/pr-12159
Jafar Al-Gharaibeh [Wed, 2 Nov 2022 03:59:17 +0000 (22:59 -0500)]
Merge pull request #12242 from FRRouting/mergify/bp/dev/8.4/pr-12159

bgpd: Notify BGP conditional advertisement thread when the peer goes down (backport #12159)

2 years agobgpd: Notify BGP conditional advertisement thread when the peer goes down 12242/head
Donatas Abraitis [Thu, 20 Oct 2022 08:21:51 +0000 (11:21 +0300)]
bgpd: Notify BGP conditional advertisement thread when the peer goes down

Also, make sure we check if the advertisement table changed using FROM peer,
not TO peer.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0775362306d51ceb3ca847f3aacd9b0b8451465b)

2 years agoMerge pull request #12228 from FRRouting/mergify/bp/dev/8.4/pr-12215
Jafar Al-Gharaibeh [Sun, 30 Oct 2022 05:11:40 +0000 (00:11 -0500)]
Merge pull request #12228 from FRRouting/mergify/bp/dev/8.4/pr-12215

ospfd: remove asster on zero length LSA - which is permitted by spec (backport #12215)

2 years agoMerge pull request #12227 from FRRouting/mergify/bp/dev/8.4/pr-12222
Jafar Al-Gharaibeh [Sun, 30 Oct 2022 05:11:14 +0000 (00:11 -0500)]
Merge pull request #12227 from FRRouting/mergify/bp/dev/8.4/pr-12222

ospfd: fix bug where acks were not be generated to incoming P2P/P2MP peers (backport #12222)

2 years agoMerge pull request #12213 from FRRouting/mergify/bp/dev/8.4/pr-12200
Jafar Al-Gharaibeh [Sun, 30 Oct 2022 05:11:06 +0000 (00:11 -0500)]
Merge pull request #12213 from FRRouting/mergify/bp/dev/8.4/pr-12200

pimd, pim6d: Fix rp-info OIF having PIM disabled interface (backport #12200)

2 years agoMerge pull request #12225 from FRRouting/mergify/bp/dev/8.4/pr-12220
Jafar Al-Gharaibeh [Sun, 30 Oct 2022 05:10:51 +0000 (00:10 -0500)]
Merge pull request #12225 from FRRouting/mergify/bp/dev/8.4/pr-12220

doc: Update with right default FPM server port (backport #12220)

2 years agoospfd: catch and report runt LSAs 12228/head
Lou Berger [Fri, 28 Oct 2022 16:06:04 +0000 (16:06 +0000)]
ospfd: catch and report runt LSAs

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 53674eaba6a34f42f322f79449c2ab667884fb82)

2 years agoospfd: remove assert on zero length LSA - which is permitted by spec
Lou Berger [Thu, 27 Oct 2022 19:12:23 +0000 (19:12 +0000)]
ospfd: remove assert on zero length LSA - which is permitted by spec

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 15c4dd82dba35467c598d48407dc1238983bb31b)

2 years agoMerge pull request #12214 from FRRouting/mergify/bp/dev/8.4/pr-12211
Jafar Al-Gharaibeh [Sat, 29 Oct 2022 21:57:51 +0000 (16:57 -0500)]
Merge pull request #12214 from FRRouting/mergify/bp/dev/8.4/pr-12211

pimd: fixing some coverity issues (backport #12211)

2 years agoospfd: fix bug where acks were not be generated to incoming P2P/P2MP neighbors 12227/head
Lou Berger [Sat, 29 Oct 2022 17:17:56 +0000 (17:17 +0000)]
ospfd: fix bug where acks were not be generated to incoming P2P/P2MP neighbors

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit dd3b58a00aebc1b72c2dc18cc28d9cb6bbcd1c5b)

2 years agoMerge pull request #12223 from FRRouting/mergify/bp/dev/8.4/pr-12172
Jafar Al-Gharaibeh [Sat, 29 Oct 2022 21:57:34 +0000 (16:57 -0500)]
Merge pull request #12223 from FRRouting/mergify/bp/dev/8.4/pr-12172

OSPF opaques LSA API - fix bug with LL API delete, add option for zero data length withdrawals (backport #12172)

2 years agodoc: Update with right default FPM server port 12225/head
Spoorthi K [Sat, 29 Oct 2022 08:39:00 +0000 (14:09 +0530)]
doc: Update with right default FPM server port

Signed-off-by: Spoorthi K <spk@redhat.com>
(cherry picked from commit aa52f3189b576dd8fea7ae183d0f7e7dc4307020)

2 years agotopotest: ospfapi - test opaque all type add/withdrawals, with and wo zero length 12223/head
Lou Berger [Wed, 19 Oct 2022 20:26:13 +0000 (20:26 +0000)]
topotest: ospfapi - test opaque all type add/withdrawals, with and wo zero length

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit c4fff21b8bd96ab0fbf659da3e6d151b341eb963)

2 years agoospfd/ospfclient: add option to flush/withdrawal with zero length
Lou Berger [Sun, 16 Oct 2022 15:19:37 +0000 (15:19 +0000)]
ospfd/ospfclient: add option to flush/withdrawal with zero length

default behavior is unchanged, i.e., to not zero

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 2f30cb25747dc9657046c59ca1f378203192de26)

2 years agoospfd: ospf_apiserver.c - fix link local opaque LSA delete
Lou Berger [Fri, 21 Oct 2022 11:12:11 +0000 (11:12 +0000)]
ospfd: ospf_apiserver.c - fix link local opaque LSA delete

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 08172828f6dc0950431e57e43b0aa2dc674cb6fe)

2 years agopimd: Dereference before null check 12214/head
Sai Gomathi N [Thu, 27 Oct 2022 09:36:00 +0000 (02:36 -0700)]
pimd: Dereference before null check

In pim_ecmp_nexthop_search: All paths that lead to this null pointer comparison already dereference the pointer earlier
There may be a null pointer dereference, or else the comparison against null is unnecessary.

Coverity CID-1519749

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
(cherry picked from commit b6467a4274df734c5a5d1bf4cf9ab5c6d0b8a475)

2 years agopimd: Unchecked return value
Sai Gomathi N [Thu, 27 Oct 2022 08:52:31 +0000 (01:52 -0700)]
pimd: Unchecked return value

In tib_sg_oil_setup: Value returned from a function is not checked for errors before being used.
If the function returns an error value, the error value may be mistaken for a normal value.
Here, only the nexthop value is being used. So casted the return type to void.

Coverity CID-1519816

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
(cherry picked from commit f13530f23a9ba73027f8f40b78eb81396afaa092)

2 years agopimd, pim6d: Fix rp-info OIF having PIM disabled interface 12213/head
Sarita Patra [Wed, 26 Oct 2022 04:25:23 +0000 (21:25 -0700)]
pimd, pim6d: Fix rp-info OIF having PIM disabled interface

Problem:
frr(config)# show ip pim rp-info
RP address group/prefix-list OIF I am RP Source Group-Type
109.0.0.3 224.0.0.0/4 ens192 no Static ASM

frr(config)# int ens192
frr(config-if)# no ip pim

frr(config) show ip pim rp-info
RP address group/prefix-list OIF I am RP Source Group-Type
109.0.0.3 224.0.0.0/4 ens192 no Static ASM

rp-info OIF is still having ens192 which is PIM disabled.
Fixing this as part of this PR.

Issue: #12044

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 43a18948d5239271b9e777c2ec4b7770ef0dcb15)

2 years agoMerge pull request #12209 from FRRouting/mergify/bp/dev/8.4/pr-12205
Donatas Abraitis [Thu, 27 Oct 2022 09:29:02 +0000 (10:29 +0100)]
Merge pull request #12209 from FRRouting/mergify/bp/dev/8.4/pr-12205

bgpd: Fix the condition whether nexthop is changed (backport #12205)

2 years agoMerge pull request #12208 from FRRouting/mergify/bp/dev/8.4/pr-12204
Donatas Abraitis [Thu, 27 Oct 2022 08:45:15 +0000 (09:45 +0100)]
Merge pull request #12208 from FRRouting/mergify/bp/dev/8.4/pr-12204

bgpd: Check for IP-format Site-of-Origin (backport #12204)

2 years agobgpd: Fix the condition whether nexthop is changed 12209/head
Ryoga Saito [Thu, 27 Oct 2022 01:17:50 +0000 (10:17 +0900)]
bgpd: Fix the condition whether nexthop is changed

Given that the following topology, route server MUST not modify NEXT_HOP
attribute because route server isn't in the actual routing path. This
behavior is required to comply RFC7947

(Router A) <-(eBGP peer)-> (Route Server) <-(eBGP peer)-> (Router B)

RFC7947 says as follows:

> As the route server does not participate in the actual routing of
> traffic, the NEXT_HOP attribute MUST be passed unmodified to the route
> server clients, similar to the "third-party" next-hop
> feature described in Section 5.1.3. of [RFC4271].

However, current FRR is violating RFC7947 in some cases. If routers and
route server established BGP peer over IPv6 connection and routers
advertise ipv4-vpn routes through route server, route server will modify
NEXT_HOP attribute in these advertisements.

This is because the condition to check whether NEXT_HOP attribute should
be changed or not is wrong. We should use (afi, safi) as the key to
check, but (nhafi, safi) is actually used. This causes the RFC7947
violation.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
(cherry picked from commit 5b786189bc60b07c62569a324754b4b49fe61f8e)

2 years agobgpd: Check for IP-format Site-of-Origin 12208/head
Trey Aspelund [Wed, 26 Oct 2022 20:53:09 +0000 (20:53 +0000)]
bgpd: Check for IP-format Site-of-Origin

When deciding whether to apply "neighbor soo" filtering towards a peer,
we were only looking for SoO ecoms that use either AS or AS4 encoding.
This makes sure we also check for IPv4 encoding, since we allow a user
to configure that encoding style against the peer.

Config:
```
router bgp 1
 address-family ipv4 unicast
  network 100.64.0.2/32 route-map soo-foo
  neighbor 192.168.122.12 soo 3.3.3.3:20
 exit-address-family
!
route-map soo-foo permit 10
 set extcommunity soo 3.3.3.3:20
exit
```

Before:
```
ub20# show ip bgp neighbors 192.168.122.12 advertised-routes
BGP table version is 5, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
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
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 i
*> 100.64.0.2/32    0.0.0.0                  0    100  32768 i

Total number of prefixes 2
```

After:
```
ub20# show ip bgp neighbors 192.168.122.12 advertised-routes
BGP table version is 5, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
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
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 i

Total number of prefixes 1
```

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
(cherry picked from commit 8c4d4624d2619ac23f082c354064b48b1c7e2842)

2 years agoMerge pull request #12206 from FRRouting/mergify/bp/dev/8.4/pr-12179
Donatas Abraitis [Thu, 27 Oct 2022 06:26:35 +0000 (07:26 +0100)]
Merge pull request #12206 from FRRouting/mergify/bp/dev/8.4/pr-12179

  ospf: optimization for FRR's P2MP mode (backport #12179)

2 years agoMerge pull request #12207 from FRRouting/mergify/bp/dev/8.4/pr-12190
Donatas Abraitis [Thu, 27 Oct 2022 06:26:17 +0000 (07:26 +0100)]
Merge pull request #12207 from FRRouting/mergify/bp/dev/8.4/pr-12190

ospf6d: Fix for memory leak issues in ospf6. (backport #12190)

2 years agoospf6d: Fix for memory leak issues in ospf6. 12207/head
Manoj Naragund [Tue, 25 Oct 2022 07:43:10 +0000 (00:43 -0700)]
ospf6d: Fix for memory leak issues in ospf6.

Problem:
Multiple memory leaks in ospf6.

 260 ==6637== 32 bytes in 1 blocks are definitely lost in loss record 5 of 24
 261 ==6637==    at 0x4C31FAC: calloc (vg_replace_malloc.c:762)
 262 ==6637==    by 0x4E8A1BF: qcalloc (memory.c:111)
 263 ==6637==    by 0x11EE27: ospf6_summary_add_aggr_route_and_blackhole (ospf6_asbr.c:2779)
 264 ==6637==    by 0x11EEBA: ospf6_originate_new_aggr_lsa (ospf6_asbr.c:2811)
 265 ==6637==    by 0x4E7C6A7: hash_clean (hash.c:325)
 266 ==6637==    by 0x11FA93: ospf6_handle_external_aggr_update (ospf6_asbr.c:3164)
 267 ==6637==    by 0x11FA93: ospf6_asbr_summary_process (ospf6_asbr.c:3386)
 268 ==6637==    by 0x4EB739B: thread_call (thread.c:1692)
 269 ==6637==    by 0x4E85B17: frr_run (libfrr.c:1068)
 270 ==6637==    by 0x119535: main (ospf6_main.c:228)

 356 ==6637== 240 bytes in 12 blocks are indirectly lost in loss record 13 of 24
 357 ==6637==    at 0x4C2FE96: malloc (vg_replace_malloc.c:309)
 358 ==6637==    by 0x4E8A0DA: qmalloc (memory.c:106)
 359 ==6637==    by 0x13545C: ospf6_lsa_alloc (ospf6_lsa.c:724)
 360 ==6637==    by 0x1354E3: ospf6_lsa_create_headeronly (ospf6_lsa.c:756)
 361 ==6637==    by 0x1355F2: ospf6_lsa_copy (ospf6_lsa.c:790)
 362 ==6637==    by 0x13B58B: ospf6_dbdesc_recv_slave (ospf6_message.c:976)
 363 ==6637==    by 0x13B58B: ospf6_dbdesc_recv (ospf6_message.c:1038)
 364 ==6637==    by 0x13B58B: ospf6_read_helper (ospf6_message.c:1838)
 365 ==6637==    by 0x13B58B: ospf6_receive (ospf6_message.c:1875)
 366 ==6637==    by 0x4EB739B: thread_call (thread.c:1692)
 367 ==6637==    by 0x4E85B17: frr_run (libfrr.c:1068)
 368 ==6637==    by 0x119535: main (ospf6_main.c:228)

RCA:
1. when the ospf6 area is being deleted, the neighbor related information
   was not being cleaned up.
2. when aggr route gets deleted from rt_aggr_tbl the corrsponding summary
   route attched to the aggr route was not being deleted.

Fix:
Added the ospf6_neighbor_delete in ospf6_area_delete to free the
neighbor related information and added ospf6_route_delete while
freeing external aggr route to free the summary route.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
(cherry picked from commit 0022611fb729c6d53ff2efa3f77254ff07fbe0a4)

2 years agoospf: optimization for FRR's P2MP mode 12206/head
Lou Berger [Fri, 21 Oct 2022 20:35:13 +0000 (20:35 +0000)]
ospf: optimization for FRR's P2MP mode

FRR implements a non-standard, but compatible approach for
sending update LSAs (it always send to 224.0.0.5) on P2MP
interfaces. This change makes it so acks are also sent to
224.0.0.5.

Since the acks are multicast, this allows an optimization
where we don't send back out the incoming P2MP interface
immediately allow time to rx multicast ack from neighbors
on the same net that rx'ed the original (multicast) update.

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit c706f0e32ba8aa8780a0618b6fbba364c383ae05)

2 years agotopotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info
Lou Berger [Fri, 21 Oct 2022 16:44:45 +0000 (16:44 +0000)]
topotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 675ba67d89b1bc3fc2364ff2aabc50392456d1d0)

2 years agoMerge pull request #12198 from FRRouting/mergify/bp/dev/8.4/pr-12142
Donald Sharp [Tue, 25 Oct 2022 17:52:28 +0000 (13:52 -0400)]
Merge pull request #12198 from FRRouting/mergify/bp/dev/8.4/pr-12142

bgpd: Honor default holdtime when triggering session reset for SendHoldTimer (backport #12142)

2 years agobgpd: Honor default holdtime when triggering session reset for SendHoldTimer 12198/head
Donatas Abraitis [Mon, 17 Oct 2022 10:34:41 +0000 (13:34 +0300)]
bgpd: Honor default holdtime when triggering session reset for SendHoldTimer

If the timer is not explicitly configured for a peer, the default timer
is not taken into account and SendHoldTimer mechanism does not work at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 460ed839b57199cfb7fc9e71d4f861e22454ae18)

2 years agoMerge pull request #12194 from FRRouting/mergify/bp/dev/8.4/pr-12178
Donald Sharp [Tue, 25 Oct 2022 12:19:52 +0000 (08:19 -0400)]
Merge pull request #12194 from FRRouting/mergify/bp/dev/8.4/pr-12178

Revert "doc: Add `neighbor PEER extended-optional-parameters` command" (backport #12178)

2 years agoRevert "doc: Add `neighbor PEER extended-optional-parameters` command" 12194/head
Donatas Abraitis [Fri, 21 Oct 2022 18:45:29 +0000 (21:45 +0300)]
Revert "doc: Add `neighbor PEER extended-optional-parameters` command"

I don't know how I missed that it was already defined. Let's just revert it.

This reverts commit 13111667513a0f91a8e875cdf12c940ea2b60b05.

(cherry picked from commit 37abfd6d191389718557730e28ad0caa77e4ba93)