]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
2 years agoFRR Release 8.3.2 frr-8.3.2
Jafar Al-Gharaibeh [Wed, 15 Mar 2023 21:53:12 +0000 (16:53 -0500)]
FRR Release 8.3.2

This a convenience release/tag for house keeping. We currently don't plan to publish
binary packages with this release.

Changelog:

bgpd
    Allow `network xxx` to work with bgp suppress-fib-pending
    Ensure frr has enough data to read 2 bytes in bgp_open_option_parse
    Ensure frr has enough data to read 2 bytes in peek_for_as4_capability
    Ensure that bgp open message stream has enough data to read
    Fix "no match rpki" in route-map
    Fix crash for `set ipv4/ipv6 vpn next-hop` command
    Fix display bgp large-community exact-match
    Flowspec overflow issue
    Make sure hdr length is at a minimum of what is expected
    Release rcu lock in bgp keepalive pthread

doc
    Add `neighbor peer extended-optional-parameters` command

docker
    Keep and copy .apk files after they are built

isisd
    Ensure rcap is freed in error case

lib
    Disable vrf before terminating interfaces
    Free some memory in scripting subsystem at shutdown

ospfclient
    Add 'wait,<seconds>' action to ospfclient.py - for testing
    Ensure ospf_apiclient_lsa_originate cannot accidently write into stack

ospfd
    Allow for zero length opaque lsas (which is permitted per rfc 5250)
    Fix rfc conformance test cases 25.19 and 27.6
    Fixing memleak.

revert "doc
    Add `neighbor peer extended-optional-parameters` command"

ripd
    Cleanup memory allocations on shutdown

ripngd
    Cleanup memory allocations on shutdown

staticd
    Clean up zclient on shutdown

tools
    Apply black formatting for frr-reload.py
    Handle sequence numbers for bgp community (large/ext) in frr-reload.py

topotests
    Ospfapi - enahnce test to cover explicit delete and 0 len opaque lsas

zebrad
    Cleanup memory leaks on shutdown
    Zrouter.mh_info is leaked on shutdown

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #12985 from FRRouting/mergify/bp/stable/8.3/pr-11913
Donatas Abraitis [Mon, 13 Mar 2023 19:28:54 +0000 (21:28 +0200)]
Merge pull request #12985 from FRRouting/mergify/bp/stable/8.3/pr-11913

bgpd: release rcu lock in bgp keepalive pthread (backport #11913)

2 years agobgpd: release rcu lock in bgp keepalive pthread
Mark Stapp [Tue, 6 Sep 2022 12:34:10 +0000 (05:34 -0700)]
bgpd: release rcu lock in bgp keepalive pthread

Don't hold the rcu lock in the bgp keepalive pthread: it
blocks the rcu pthread and prevents log-file deletion.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
(cherry picked from commit 85ba04f3897d3c9def83d8b291b6c6a276e96c54)

2 years agoMerge pull request #12893 from FRRouting/mergify/bp/stable/8.3/pr-12884
Donald Sharp [Fri, 24 Feb 2023 14:27:01 +0000 (09:27 -0500)]
Merge pull request #12893 from FRRouting/mergify/bp/stable/8.3/pr-12884

bgpd: Flowspec overflow issue (backport #12884)

2 years agobgpd: Flowspec overflow issue
Donald Sharp [Thu, 23 Feb 2023 18:29:32 +0000 (13:29 -0500)]
bgpd: Flowspec overflow issue

According to the flowspec RFC 8955 a flowspec nlri is <length, <nlri data>>
Specifying 0 as a length makes BGP get all warm on the inside.  Which
in this case is not a good thing at all.  Prevent warmth, stay cold
on the inside.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0b999c886e241c52bd1f7ef0066700e4b618ebb3)

2 years agoMerge pull request #12421 from FRRouting/mergify/bp/stable/8.3/pr-12367
Donatas Abraitis [Wed, 30 Nov 2022 07:45:42 +0000 (09:45 +0200)]
Merge pull request #12421 from FRRouting/mergify/bp/stable/8.3/pr-12367

ospfd: Fixing a memleak. (backport #12367)

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

2 years agoMerge pull request #12401 from FRRouting/mergify/bp/stable/8.3/pr-12370
Donatas Abraitis [Sat, 26 Nov 2022 19:18:58 +0000 (21:18 +0200)]
Merge pull request #12401 from FRRouting/mergify/bp/stable/8.3/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
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 #12388 from FRRouting/mergify/bp/stable/8.3/pr-12317
Donatas Abraitis [Fri, 25 Nov 2022 07:37:29 +0000 (09:37 +0200)]
Merge pull request #12388 from FRRouting/mergify/bp/stable/8.3/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
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 agoMerge pull request #12383 from FRRouting/mergify/bp/stable/8.3/pr-12374
Donatas Abraitis [Thu, 24 Nov 2022 12:12:41 +0000 (14:12 +0200)]
Merge pull request #12383 from FRRouting/mergify/bp/stable/8.3/pr-12374

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

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

2 years agoMerge pull request #12250 from FRRouting/mergify/bp/stable/8.3/pr-12247
Jafar Al-Gharaibeh [Thu, 3 Nov 2022 03:36:48 +0000 (22:36 -0500)]
Merge pull request #12250 from FRRouting/mergify/bp/stable/8.3/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
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 #12192 from FRRouting/mergify/bp/stable/8.3/pr-12178
Donald Sharp [Tue, 25 Oct 2022 12:19:20 +0000 (08:19 -0400)]
Merge pull request #12192 from FRRouting/mergify/bp/stable/8.3/pr-12178

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

2 years agoRevert "doc: Add `neighbor PEER extended-optional-parameters` command"
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)

2 years agoMerge pull request #12174 from FRRouting/mergify/bp/stable/8.3/pr-12155
Donatas Abraitis [Sun, 23 Oct 2022 15:53:20 +0000 (18:53 +0300)]
Merge pull request #12174 from FRRouting/mergify/bp/stable/8.3/pr-12155

OSPF: allow for zero length opaque LSAs (backport #12155)

2 years agotopotests: ospfapi - enahnce test to cover explicit delete and 0 len opaque LSAs
Lou Berger [Wed, 19 Oct 2022 13:07:02 +0000 (13:07 +0000)]
topotests: ospfapi - enahnce test to cover explicit delete and 0 len opaque LSAs

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

2 years agoospfclient: add 'wait,<seconds>' action to ospfclient.py - for testing
Lou Berger [Wed, 19 Oct 2022 11:52:30 +0000 (11:52 +0000)]
ospfclient: add 'wait,<seconds>' action to ospfclient.py - for testing

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

2 years agoospfd: allow for zero length opaque LSAs (which is permitted per RFC 5250)
Lou Berger [Wed, 19 Oct 2022 11:50:41 +0000 (11:50 +0000)]
ospfd: allow for zero length opaque LSAs (which is permitted per RFC 5250)

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

2 years agoMerge pull request #12132 from FRRouting/mergify/bp/stable/8.3/pr-12113
Donatas Abraitis [Fri, 14 Oct 2022 11:17:53 +0000 (14:17 +0300)]
Merge pull request #12132 from FRRouting/mergify/bp/stable/8.3/pr-12113

bgpd: Allow `network XXX` to work with bgp suppress-fib-pending (backport #12113)

2 years agobgpd: Allow `network XXX` to work with bgp suppress-fib-pending
Donald Sharp [Wed, 12 Oct 2022 18:53:21 +0000 (14:53 -0400)]
bgpd: Allow `network XXX` to work with bgp suppress-fib-pending

When bgp is using `bgp suppress-fib-pending` and the end
operator is using network statements, bgp was not sending
the network'ed prefix'es to it's peers.  Fix this.

Also update the test cases for bgp_suppress_fib to test
this new corner case( I am sure that there are going to
be others that will need to be added ).

Fixes: #12112
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 4801fc4670020406fc609dedabc7482d88e3b656)

2 years agoMerge pull request #12120 from FRRouting/mergify/bp/stable/8.3/pr-12108
Donatas Abraitis [Thu, 13 Oct 2022 09:41:36 +0000 (12:41 +0300)]
Merge pull request #12120 from FRRouting/mergify/bp/stable/8.3/pr-12108

General mayhem (backport #12108)

2 years agozebra: Cleanup memory leaks on shutdown
Donald Sharp [Tue, 11 Oct 2022 20:26:42 +0000 (16:26 -0400)]
zebra: Cleanup memory leaks on shutdown

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

2 years agoripngd: Cleanup memory allocations on shutdown
Donald Sharp [Tue, 11 Oct 2022 20:21:44 +0000 (16:21 -0400)]
ripngd: Cleanup memory allocations on shutdown

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

2 years agoripd: Cleanup memory allocations on shutdown
Donald Sharp [Tue, 11 Oct 2022 20:21:30 +0000 (16:21 -0400)]
ripd: Cleanup memory allocations on shutdown

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

2 years agozebra: zrouter.mh_info is leaked on shutdown
Donald Sharp [Tue, 11 Oct 2022 19:22:04 +0000 (15:22 -0400)]
zebra: zrouter.mh_info is leaked on shutdown

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

2 years agolib: Free some memory in scripting subsystem at shutdown
Donald Sharp [Tue, 11 Oct 2022 17:21:03 +0000 (13:21 -0400)]
lib: Free some memory in scripting subsystem at shutdown

Pre:
staticd: showing active allocations in memory group libfrr
staticd: memstats:  Scripting                     :     16 * (variably sized)
staticd: memstats:  Hash                          :      2 * (variably sized)
staticd: memstats:  Hash Bucket                   :      8 *         32
staticd: memstats:  Hash Index                    :      1 * (variably sized)
staticd: memstats:  Link List                     :      1 *         40
staticd: memstats:  Link Node                     :      1 *         24
staticd: showing active allocations in memory group logging subsystem
staticd: memstats:  log file target               :      1 *         88
staticd: showing active allocations in memory group staticd

Post:
staticd: showing active allocations in memory group libfrr
staticd: showing active allocations in memory group logging subsystem
staticd: memstats:  log file target               :      1 *         88
staticd: showing active allocations in memory group staticd

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

2 years agostaticd: Clean up zclient on shutdown
Donald Sharp [Tue, 11 Oct 2022 16:57:57 +0000 (12:57 -0400)]
staticd: Clean up zclient on shutdown

The zclient data structure was not being cleaned up on shutdown.

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

2 years agoMerge pull request #12111 from FRRouting/mergify/bp/stable/8.3/pr-12105
Donatas Abraitis [Wed, 12 Oct 2022 20:16:53 +0000 (23:16 +0300)]
Merge pull request #12111 from FRRouting/mergify/bp/stable/8.3/pr-12105

tools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py (backport #12105)

2 years agotools: Apply black formatting for frr-reload.py
Donatas Abraitis [Tue, 11 Oct 2022 19:38:30 +0000 (22:38 +0300)]
tools: Apply black formatting for frr-reload.py

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

2 years agotools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py
Donatas Abraitis [Tue, 11 Oct 2022 19:36:26 +0000 (22:36 +0300)]
tools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py

If we add/modify community/large/ext lists without sequence numbers, and
doing frr-reload.py, then rules with sequence numbers (show running-config
always adds sequence numbers) will be deleted and new ones will be re-added.

This could lead to blackholing for some time.

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

2 years agoMerge pull request #12102 from FRRouting/mergify/bp/stable/8.3/pr-12087
Donatas Abraitis [Wed, 12 Oct 2022 11:03:04 +0000 (14:03 +0300)]
Merge pull request #12102 from FRRouting/mergify/bp/stable/8.3/pr-12087

bgpd: fix "no match rpki" in route-map (backport #12087)

2 years agoMerge pull request #12077 from FRRouting/mergify/bp/stable/8.3/pr-11656
Donatas Abraitis [Tue, 11 Oct 2022 15:00:40 +0000 (18:00 +0300)]
Merge pull request #12077 from FRRouting/mergify/bp/stable/8.3/pr-11656

Some memory (backport #11656)

2 years agobgpd: fix "no match rpki" in route-map
Alexander Chernavin [Mon, 10 Oct 2022 13:17:54 +0000 (13:17 +0000)]
bgpd: fix "no match rpki" in route-map

With this fix, make "no match rpki" in a route-map actually remove the
node in the candidate configuration instead of creating it.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 87c3ed1bf82ae84eae6c9848b4c53de721671401)

2 years agobgpd: Make sure hdr length is at a minimum of what is expected
Donald Sharp [Thu, 21 Jul 2022 12:11:58 +0000 (08:11 -0400)]
bgpd: Make sure hdr length is at a minimum of what is expected

Ensure that if the capability length specified is enough data.

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

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

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

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

2 years agoospfclient: Ensure ospf_apiclient_lsa_originate cannot accidently write into stack
Donald Sharp [Wed, 20 Jul 2022 20:43:17 +0000 (16:43 -0400)]
ospfclient: Ensure ospf_apiclient_lsa_originate cannot accidently write into stack

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

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

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

2 years agoMerge pull request #12093 from FRRouting/mergify/bp/stable/8.3/pr-12084
Donatas Abraitis [Tue, 11 Oct 2022 09:58:43 +0000 (12:58 +0300)]
Merge pull request #12093 from FRRouting/mergify/bp/stable/8.3/pr-12084

bgpd: fix display bgp large-community exact-match (backport #12084)

2 years agobgpd: fix display bgp large-community exact-match
Your Name [Mon, 10 Oct 2022 10:51:27 +0000 (13:51 +0300)]
bgpd: fix display bgp large-community exact-match

Before patch:
frr# show bgp large-community 1:1:1 exact-match
% Large-community malformed

After patch:
frr# show bgp large-community 1:1:1 exact-match

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
(cherry picked from commit 1857760c1ed38250d6be0d92502f9dc816d4e4cc)

2 years agoMerge pull request #12079 from FRRouting/mergify/bp/stable/8.3/pr-12043
Donald Sharp [Fri, 7 Oct 2022 23:46:02 +0000 (19:46 -0400)]
Merge pull request #12079 from FRRouting/mergify/bp/stable/8.3/pr-12043

Bgp hate (backport #12043)

2 years agobgpd: Ensure FRR has enough data to read 2 bytes in bgp_open_option_parse
Donald Sharp [Fri, 30 Sep 2022 12:57:43 +0000 (08:57 -0400)]
bgpd: Ensure FRR has enough data to read 2 bytes in bgp_open_option_parse

In bgp_open_option_parse the code is checking that the
stream has at least 2 bytes to read ( the opt_type and
the opt_length).  However if BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer)
is configured then FRR is reading 3 bytes.  Which is not good
since the packet could be badly formateed.  Ensure that
FRR has the appropriate data length to read the data.

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

2 years agobgpd: Ensure FRR has enough data to read 2 bytes in peek_for_as4_capability
Donald Sharp [Fri, 30 Sep 2022 12:51:45 +0000 (08:51 -0400)]
bgpd: Ensure FRR has enough data to read 2 bytes in peek_for_as4_capability

In peek_for_as4_capability the code is checking that the
stream has at least 2 bytes to read ( the opt_type and the
opt_length ).  However if BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer)
is configured then FRR is reading 3 bytes.  Which is not good
since the packet could be badly formated.  Ensure that
FRR has the appropriate data length to read the data.

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

2 years agoMerge pull request #12033 from FRRouting/mergify/bp/stable/8.3/pr-12006
Donald Sharp [Wed, 28 Sep 2022 12:28:05 +0000 (08:28 -0400)]
Merge pull request #12033 from FRRouting/mergify/bp/stable/8.3/pr-12006

doc: Add `neighbor PEER extended-optional-parameters` command (backport #12006)

2 years agoMerge pull request #11978 from opensourcerouting/fix/docker_alpine_apk_8.3
Jafar Al-Gharaibeh [Tue, 27 Sep 2022 15:32:44 +0000 (10:32 -0500)]
Merge pull request #11978 from opensourcerouting/fix/docker_alpine_apk_8.3

docker: [8.3] Keep and copy .apk files after they are built

2 years agodoc: Add `neighbor PEER extended-optional-parameters` command
Donatas Abraitis [Sun, 25 Sep 2022 18:02:06 +0000 (21:02 +0300)]
doc: Add `neighbor PEER extended-optional-parameters` command

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

2 years agodocker: Keep and copy .apk files after they are built
Donatas Abraitis [Tue, 20 Sep 2022 20:23:55 +0000 (23:23 +0300)]
docker: Keep and copy .apk files after they are built

For debugging purposes and/or to distribute them somewhere else.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoFRRouting Release 8.3.1 docker/8.3.1 frr-8.3.1
Donatas Abraitis [Tue, 30 Aug 2022 17:53:45 +0000 (20:53 +0300)]
FRRouting Release 8.3.1

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11881 from FRRouting/mergify/bp/stable/8.3/pr-11866
Donatas Abraitis [Tue, 30 Aug 2022 17:36:05 +0000 (20:36 +0300)]
Merge pull request #11881 from FRRouting/mergify/bp/stable/8.3/pr-11866

zebra: fix missing vni transition (backport #11866)

2 years agoMerge pull request #11880 from FRRouting/mergify/bp/stable/8.3/pr-11870
Donatas Abraitis [Tue, 30 Aug 2022 15:51:42 +0000 (18:51 +0300)]
Merge pull request #11880 from FRRouting/mergify/bp/stable/8.3/pr-11870

ospfd: crash when router acts as GR helper upon a topo change (backport #11870)

2 years agozebra: fix missing vni transition
anlan_cs [Fri, 26 Aug 2022 10:53:03 +0000 (06:53 -0400)]
zebra: fix missing vni transition

`show evpn vni detail` doesn't reflect any change in vni transition.
Need to add processing in command of `[no] vni (1-16777215)`.

With the config:
```
!
vni 66
!
vrf vrf1
 vni 88
 exit-vrf
!
```

Before:
```
(config-vrf)# no vni 88
(config-vrf)# do show evpn vni detail
VNI: 66
  Type: L3
  Tenant VRF: default
  L2 VNIs: <- Empty
```

After:
```
(config-vrf)# no vni 88
(config-vrf)# do show evpn vni detail
VNI: 66
  Type: L3
  Tenant VRF: default
  L2 VNIs: 88 <-
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit df78d91d8aab3bdb5b7fc8db6c451aa1d9be7b78)

2 years agoospfd: crash when router acts as GR helper upon a topo change
rgirada [Mon, 29 Aug 2022 10:51:39 +0000 (03:51 -0700)]
ospfd: crash when router acts as GR helper upon a topo change

Description:
ospf process is crashing when  the current router acts
as GR helper and it received a new lsa.

Here, ospf_lsa_different() is being called without checking
'old' pointer. It is asserted in ospf_lsa_different() api
if the 'old' pointer is NULL.

corrected this by validaing old pointer before calling
ospf_lsa_different() api.

back tarce:
Program terminated with signal SIGABRT, Aborted.
0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
[Current thread is 1 (Thread 0x6b84348827c0 (LWP 3155))]
0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1  0x00006b8433aa4801 in __GI_abort () at abort.c:79
2  0x00006b8433a9439a in __assert_fail_base (fmt=0x6b8433c1b7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x162ffc0630bc "l1", file=file@entry=0x162ffc062ff7 "ospfd/ospf_lsa.c", line=line@entry=3520, function=function@entry=0x162ffc0646f0 <__PRETTY_FUNCTION__.18732> "ospf_lsa_different") at assert.c:92
3  0x00006b8433a94412 in __GI___assert_fail (assertion=assertion@entry=0x162ffc0630bc "l1", file=file@entry=0x162ffc062ff7 "ospfd/ospf_lsa.c", line=line@entry=3520, function=function@entry=0x162ffc0646f0 <__PRETTY_FUNCTION__.18732> "ospf_lsa_different") at assert.c:101
4  0x0000162ffc008c25 in ospf_lsa_different (l1=l1@entry=0x0, l2=l2@entry=0x162ffe535c60, ignore_rcvd_flag=ignore_rcvd_flag@entry=true) at ospfd/ospf_lsa.c:3520
5  0x0000162ffc00a8e8 in ospf_lsa_install (ospf=ospf@entry=0x162ffe513650, oi=oi@entry=0x162ffe531c30, lsa=lsa@entry=0x162ffe535c60) at ospfd/ospf_lsa.c:2892
6  0x0000162ffc059d16 in ospf_flood (ospf=0x162ffe513650, nbr=nbr@entry=0x162ffe52cc90, current=current@entry=0x0, new=new@entry=0x162ffe535c60) at ospfd/ospf_flood.c:429
7  0x0000162ffc01838f in ospf_ls_upd (size=<optimized out>, oi=0x162ffe531c30, s=<optimized out>, ospfh=<optimized out>, iph=<optimized out>, ospf=<optimized out>) at ospfd/ospf_packet.c:2162
8  ospf_read_helper (ospf=<optimized out>) at ospfd/ospf_packet.c:3241
9  ospf_read (thread=<optimized out>) at ospfd/ospf_packet.c:3272
10 0x00006b843450139c in thread_call (thread=thread@entry=0x7780f42c7480) at lib/thread.c:1692
11 0x00006b84344cfb18 in frr_run (master=0x162ffe34d130) at lib/libfrr.c:1068

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
(cherry picked from commit ef151af79b90aaa0b9637e0280e0a9d1eb408523)

2 years agoMerge pull request #11876 from opensourcerouting/fix/backport_4cc5d80965f7be32cc481ed...
Donald Sharp [Tue, 30 Aug 2022 11:54:42 +0000 (07:54 -0400)]
Merge pull request #11876 from opensourcerouting/fix/backport_4cc5d80965f7be32cc481ed4e1df18c6a67dbae9_8.3

pimd, pim6d: deleting the memory malloced for json.

2 years agopimd, pim6d: deleting the memory malloced for json.
Abhishek N R [Mon, 29 Aug 2022 11:50:26 +0000 (04:50 -0700)]
pimd, pim6d: deleting the memory malloced for json.

Problem Statement:
=================
2022-08-18 04:57:32,376 - ERROR: Found memory leak in daemon pimd
2022-08-18 04:57:32,377 - ERROR: ==12100== 18,978 (144 direct, 18,834 indirect) bytes in 2 blocks are definitely lost in loss record 45 of 45
2022-08-18 04:57:32,377 - ERROR: ==12100==    at 0x4C31FAC: calloc (vg_replace_malloc.c:762)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x532F51F: json_object_new_object (in /lib/x86_64-linux-gnu/libjson-c.so.3.0.1)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x128B5C: pim_show_interfaces (pim_cmd_common.c:3395)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x15A86B: show_ip_pim_interface_magic (pim_cmd.c:3127)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x15A86B: show_ip_pim_interface (pim_cmd_clippy.c:324)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E672B2: cmd_execute_command_real.isra.2 (command.c:1005)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E696FE: cmd_execute_command (command.c:1064)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E698F1: cmd_execute (command.c:1227)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EBC814: vty_command (vty.c:530)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EBC9EF: vty_execute (vty.c:1295)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EBF1F7: vtysh_read (vty.c:2142)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EB739B: thread_call (thread.c:1692)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E85B17: frr_run (libfrr.c:1068)
2022-08-18 04:57:32,377 - ERROR: ==12100==

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agoMerge pull request #11873 from opensourcerouting/fix/backport_2bf9780b268d29161154e90...
Mark Stapp [Mon, 29 Aug 2022 15:46:09 +0000 (11:46 -0400)]
Merge pull request #11873 from opensourcerouting/fix/backport_2bf9780b268d29161154e90af3fd6929298eef7e_8.3

bgpd: Do not print new line for EVPN CLI outputs if it's a JSON

2 years agobgpd: Do not print new line for EVPN CLI outputs if it's a JSON
Donatas Abraitis [Thu, 25 Aug 2022 10:15:27 +0000 (13:15 +0300)]
bgpd: Do not print new line for EVPN CLI outputs if it's a JSON

Before:

```
$ vtysh -c 'show bgp l2vpn evpn route detail json'
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
{
...
"numPrefix":4,
"numPaths":4 <<<<< four paths = four empty lines
}
```

Contain as much "empty lines" before the JSON string as the number
of paths displayed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11794 from opensourcerouting/fix/backport_zebra_crash_8.3
Donald Sharp [Sat, 13 Aug 2022 00:28:46 +0000 (20:28 -0400)]
Merge pull request #11794 from opensourcerouting/fix/backport_zebra_crash_8.3

zebra: Fix crash in shutdown w/ pw thread still running

2 years agozebra: Fix crash in shutdown w/ pw thread still running
Donald Sharp [Thu, 11 Aug 2022 18:59:17 +0000 (14:59 -0400)]
zebra: Fix crash in shutdown w/ pw thread still running

I am seeing the zebra_pw_install_retry timer thread crashing
on shutdown

The shutdown of the timer is only in an
if () {
   ...
} else if

Let's just always shut it down.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11788 from opensourcerouting/fix/backport_cond_advertisements
Jafar Al-Gharaibeh [Fri, 12 Aug 2022 05:23:47 +0000 (00:23 -0500)]
Merge pull request #11788 from opensourcerouting/fix/backport_cond_advertisements

bgpd: [8.3] conditional advertisements fixes (backports)

2 years agobgpd: rename update_type enum values
Quentin Young [Fri, 11 Jun 2021 23:00:15 +0000 (19:00 -0400)]
bgpd: rename update_type enum values

These values were named WITHDRAW and UPDATE. Yeah, you guessed it, those
are already #define's elsewhere (bgp_debug.h). Hilarity ensues.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agobgpd: don't adv conditionally withdrawn routes
Quentin Young [Fri, 11 Jun 2021 23:01:42 +0000 (19:01 -0400)]
bgpd: don't adv conditionally withdrawn routes

If we have conditional advertisement enabled, and conditionally withdrew
some prefixes, and then we do a 'clear bgp', those routes were getting
advertised again, and then withdrawn the next time the conditional
advertisement scanner executed.

When we go to advertise check the prefix against the conditional
advertisement status so we don't do that.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agobgpd: apply cond-adv policy to update group
Quentin Young [Tue, 15 Jun 2021 23:49:19 +0000 (19:49 -0400)]
bgpd: apply cond-adv policy to update group

The new outbound filter to apply conditional advertisement policy was
not working properly due to complications with update groups. The two
routemaps were properly copied into the update group peer filter but not
the conditional advertisement state.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #11779 from FRRouting/mergify/bp/stable/8.3/pr-11776
Donald Sharp [Wed, 10 Aug 2022 21:44:27 +0000 (17:44 -0400)]
Merge pull request #11779 from FRRouting/mergify/bp/stable/8.3/pr-11776

vtysh: Handle SIGTSTP (C-z) without exiting the vty shell (backport #11776)

2 years agovtysh: Handle SIGTSTP (C-z) without exiting the vty shell
Donatas Abraitis [Wed, 10 Aug 2022 10:43:11 +0000 (13:43 +0300)]
vtysh: Handle SIGTSTP (C-z) without exiting the vty shell

After 4c92dd90d3d15cff640de063ff14eec950402d25 switching to poll-based I/O,
vtysh prompt exits on C-z signal.

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

2 years agoMerge pull request #11748 from FRRouting/mergify/bp/stable/8.3/pr-11705
Donatas Abraitis [Fri, 5 Aug 2022 10:13:29 +0000 (13:13 +0300)]
Merge pull request #11748 from FRRouting/mergify/bp/stable/8.3/pr-11705

pimd: fix static mroute to also take into account the input interface (backport #11705)

2 years agopimd: fix static mroute to also take into account the input interface
Jafar Al-Gharaibeh [Thu, 28 Jul 2022 20:38:50 +0000 (15:38 -0500)]
pimd: fix static mroute to also take into account the input interface

Allow the same group/source route to be configured on more than one interface.
Currently FRR doesn't allow adding the same mroute on different input interfaces.

Current behavior, if we have the following config:

```
interface eth1
   ip mroute eth0 239.0.0.1

interface eth2
   ip mroute eth0 239.0.0.1
```

Only one multicast route will be installed with an input interface of the last
interface configured.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit 90937e420c9a02f61dfb43ce426b573186b2e591)

2 years agoMerge pull request #11743 from FRRouting/mergify/bp/stable/8.3/pr-11742
Donald Sharp [Thu, 4 Aug 2022 11:18:25 +0000 (07:18 -0400)]
Merge pull request #11743 from FRRouting/mergify/bp/stable/8.3/pr-11742

bgpd: fix show bgp l2vpn evpn route rd crashes (backport #11742)

2 years agoMerge pull request #11735 from FRRouting/mergify/bp/stable/8.3/pr-11713
Donatas Abraitis [Thu, 4 Aug 2022 07:37:32 +0000 (10:37 +0300)]
Merge pull request #11735 from FRRouting/mergify/bp/stable/8.3/pr-11713

zebra: fix bond down for evpn-mh (backport #11713)

2 years agobgpd: fix show bgp l2vpn evpn route rd crashes
Trey Aspelund [Thu, 4 Aug 2022 01:43:31 +0000 (01:43 +0000)]
bgpd: fix show bgp l2vpn evpn route rd crashes

bgpd was crashing every time `show bgp l2vpn evpn route rd` was issued
with an RD that didn't match "all".  This was introduced by 9b01d289883
which changed how argv_find() is handled in various vtysh commands, but
the new changes forgot a "!".  So let's re-add the "!".

Before:
```
ub20# show bgp l2vpn evpn route rd 399672:100
vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error!
ub20#

ub20# show bgp l2vpn evpn route rd 399672:100 mac 11:11:11:11:11:11
vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error!
ub20#
```

After:
```
ub20# show bgp l2vpn evpn route rd 399672:100
ub20#

ub20# show bgp l2vpn evpn route rd 399672:100 mac 11:11:11:11:11:11
% Network not in table
ub20#
```

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

2 years agoMerge pull request #11728 from FRRouting/mergify/bp/stable/8.3/pr-11703
Donald Sharp [Wed, 3 Aug 2022 14:30:34 +0000 (10:30 -0400)]
Merge pull request #11728 from FRRouting/mergify/bp/stable/8.3/pr-11703

isisd: Prevent leak of global_ipv6_addrs (backport #11703)

2 years agozebra: fix bond down for evpn-mh
anlan_cs [Mon, 1 Aug 2022 07:30:07 +0000 (03:30 -0400)]
zebra: fix bond down for evpn-mh

The test case is with `redirect-off` in evpn multi-homing environment:
```
evpn mh redirect-off
```

After the environment is setup, do the following steps:
1) Let one member of ES learn one mac:
```
2e:52:bb:bb:2f:46 dev ae1 vlan 100 master bridge0 static
```
Now everything is ok and the mac can be synced to other ES peers.

2) Shutdown bond1. At this time, zebra will get three netlink messages,
not one as current code expected. Like:
```
e4:f0:04:89:b6:46 dev vxlan10030 vlan 30 master bridge0 static <-A
e4:f0:04:89:b6:46 dev vxlan10030 nhid 536870913 self extern_learn <-B
e4:f0:04:89:b6:46 dev vxlan10030 vlan 30 self <-C
```

With A), zebra will wrongly remove this mac again:
```
ZEBRA: dpAdd remote MAC e4:f0:04:89:b6:46 VID 30
ZEBRA: Add/update remote MAC e4:f0:04:89:b6:46 intf vxlan10030(26) VNI 10030 flags 0xa01 - del local
ZEBRA: Send MACIP Del f None  MAC e4:f0:04:89:b6:46 IP (null) seq 0 L2-VNI 10030 ESI - to bgp
```

With C), zebra will wrongly add this mac again:
```
ZEBRA: Rx RTM_NEWNEIGH AF_BRIDGE IF 26 VLAN 30 st 0x2 fl 0x2 MAC e4:f0:04:89:b6:46 nhg 0
ZEBRA: dpAdd remote MAC e4:f0:04:89:b6:46 VID 30
```

zebra should skip the two messages with `vid`. Otherwise, it will send many
*wrong* messages to bgpd, and the logic is wrong.

`nhg/dst` is in 2nd message without `vid`, it is useful to call
`zebra_evpn_add_update_local_mac()`. But it will fail with "could not find EVPN"
warning for no `vid`, can't call `zebra_evpn_add_update_local_mac()`:
With B):
```
ZEBRA: Rx RTM_NEWNEIGH AF_BRIDGE IF 26 st 0x2 fl 0x12 MAC e4:f0:04:89:b6:46 nhg 536870913
ZEBRA: dpAdd local-nw-MAC e4:f0:04:89:b6:46 VID 0
ZEBRA:         Add/Update MAC e4:f0:04:89:b6:46 intf ae1(18) VID 0, could not find EVPN
```
Here, we can get `vid` from vxlan interface instead of from netlink message.

In summary, `zebra_vxlan_dp_network_mac_add()` will process the three messages
wrongly expecting only one messsage, so its logic is wrong. Just skip the two
unuseful messages with `vid`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit df6c1982691df0f7a4712f1618fac2e15d076335)

2 years agoisisd: Prevent leak of global_ipv6_addrs
Donald Sharp [Thu, 28 Jul 2022 16:21:24 +0000 (12:21 -0400)]
isisd: Prevent leak of global_ipv6_addrs

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

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

2 years agoMerge pull request #11687 from opensourcerouting/fix/backport_62bf6b42000d0ecf8a92de0...
Donatas Abraitis [Wed, 27 Jul 2022 10:48:56 +0000 (13:48 +0300)]
Merge pull request #11687 from opensourcerouting/fix/backport_62bf6b42000d0ecf8a92de03797a3eebe9f48545_8.3

bgpd: Fixup pbr rule changes that were missed

2 years agobgpd: Fixup pbr rule changes that were missed
Donald Sharp [Fri, 22 Jul 2022 18:49:06 +0000 (14:49 -0400)]
bgpd: Fixup pbr rule changes that were missed

In commit: d70a31a3ef2b60d978b336d5cc9ee5e1ec079dfc

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11671 from FRRouting/mergify/bp/stable/8.3/pr-11661
Donald Sharp [Sun, 24 Jul 2022 12:07:49 +0000 (08:07 -0400)]
Merge pull request #11671 from FRRouting/mergify/bp/stable/8.3/pr-11661

bgpd: LL peers need bnc's per peer (backport #11661)

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

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

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

2 years agoMerge pull request #11664 from FRRouting/mergify/bp/stable/8.3/pr-11662
Donald Sharp [Fri, 22 Jul 2022 17:07:15 +0000 (13:07 -0400)]
Merge pull request #11664 from FRRouting/mergify/bp/stable/8.3/pr-11662

bgpd: Call a hook when as-path filter is replaced (backport #11662)

2 years agobgpd: Call a hook when as-path filter is replaced
Donatas Abraitis [Fri, 22 Jul 2022 11:16:02 +0000 (14:16 +0300)]
bgpd: Call a hook when as-path filter is replaced

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

2 years agoMerge pull request #11659 from FRRouting/mergify/bp/stable/8.3/pr-11655
Jafar Al-Gharaibeh [Thu, 21 Jul 2022 23:13:37 +0000 (18:13 -0500)]
Merge pull request #11659 from FRRouting/mergify/bp/stable/8.3/pr-11655

vtysh: Ignore `end` when parsing frr.conf (backport #11655)

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

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

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

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

2 years agoMerge pull request #11642 from FRRouting/mergify/bp/stable/8.3/pr-11635 docker/8.3.0 frr-8.3
Jafar Al-Gharaibeh [Mon, 18 Jul 2022 22:58:02 +0000 (17:58 -0500)]
Merge pull request #11642 from FRRouting/mergify/bp/stable/8.3/pr-11635

zebra: Cleanup the memory from the hash for MPLS stuff (backport #11635)

2 years agoMerge pull request #11640 from FRRouting/mergify/bp/stable/8.3/pr-11631
Jafar Al-Gharaibeh [Mon, 18 Jul 2022 19:19:34 +0000 (14:19 -0500)]
Merge pull request #11640 from FRRouting/mergify/bp/stable/8.3/pr-11631

ldpd: Check if the thread is scheduled before calling for remained time (backport #11631)

2 years agoMerge pull request #11639 from FRRouting/mergify/bp/stable/8.3/pr-11626
Jafar Al-Gharaibeh [Mon, 18 Jul 2022 19:19:19 +0000 (14:19 -0500)]
Merge pull request #11639 from FRRouting/mergify/bp/stable/8.3/pr-11626

zebra: Avoid buffer overflow using netlink_parse_rtattr_nested() (backport #11626)

2 years agoMerge pull request #11641 from FRRouting/mergify/bp/stable/8.3/pr-11627
Jafar Al-Gharaibeh [Mon, 18 Jul 2022 19:04:18 +0000 (14:04 -0500)]
Merge pull request #11641 from FRRouting/mergify/bp/stable/8.3/pr-11627

Update Alpine packaging foo + change docker images back over to Alpine-provided libyang (backport #11627)

2 years agozebra: Cleanup the memory from the hash for MPLS stuff
Donatas Abraitis [Mon, 18 Jul 2022 11:26:29 +0000 (14:26 +0300)]
zebra: Cleanup the memory from the hash for MPLS stuff

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

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

2 years agodocker: use Alpine-provided libyang
Quentin Young [Sun, 17 Jul 2022 23:10:45 +0000 (19:10 -0400)]
docker: use Alpine-provided libyang

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

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit 0bbc787cd3714d4e2521e969bf67b93462321c0f)

2 years agoalpine, docker: Update APKBUILD for libyang
Quentin Young [Sun, 17 Jul 2022 21:37:14 +0000 (17:37 -0400)]
alpine, docker: Update APKBUILD for libyang

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit d782b117d0d00d7177b438c5ebdae7bd8f8b07b1)

2 years agoldpd: Check if the thread is scheduled before calling for remained time
Donatas Abraitis [Mon, 18 Jul 2022 06:53:08 +0000 (09:53 +0300)]
ldpd: Check if the thread is scheduled before calling for remained time

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

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

2 years agozebra: Avoid buffer overflow using netlink_parse_rtattr_nested()
Donatas Abraitis [Sun, 17 Jul 2022 19:31:48 +0000 (22:31 +0300)]
zebra: Avoid buffer overflow using netlink_parse_rtattr_nested()

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

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

2 years agoFRR Release 8.3
Jafar Al-Gharaibeh [Sun, 17 Jul 2022 04:27:53 +0000 (23:27 -0500)]
FRR Release 8.3

Changelog
---------

**General**
   - Add camelcase json keys in addition to pascalcase (Wrong JSON keys will be depracated)
   - Fix corruption when route-map delete/add sequence happens (fast re-add)
   - Reworked gRPC
   - RFC5424 & journald extended syslog target

**bfdd**
   - Fix broken FSM in active/passive modes

**bgpd**
   - Notification Message Support for BGP Graceful Restart (rfc8538)
   - BGP Cease Notification Subcode For BFD
   - Send Hold Timer for BGP (own implementation without an additional knob)
   - New `set as-path replace` command for BGP route-map
   - New `match peer` command for BGP route-map
   - New `ead-es-frag evi-limit` command for EVPN
   - New `match evpn route-type` command for EVPN route-map to match Type-1/Type-4
   - JSON outputs for all RPKI show commands
   - Set attributes via route-map for BGP conditional advertisements
   - Pass non-transitive extended communities between RS and RS-clients
   - Send MED attribute when aggregate prefix is created
   - Require librtr >= 0.8.0 for RPKI to fix connection handling (failover)
   - Fix aspath memory leak in aggr_suppress_map_test
   - Fix crash for `show ip bgp vrf all all neighbors 192.168.0.1 ...`
   - Fix crash for `show ip bgp vrf all all`
   - Fix memory leak for BGP Community Alias in CLI
   - Fix memory leak when setting BGP community at egress
   - Fix memory leak when setting BGP large-community at egress
   - Fix SR color nexthop processing in BGP
   - Fix setting local-preference in route-map using +/-
   - Fix crash using Lua and route-map to set attributes via scripts
   - Fix crash when issuing various forms of `bgp no-rib`

**isisd**
   - JSON output for show summary command
   - Fix crash when MTU mismatch occurs
   - Fix crash with xfrm interface type
   - Fix infinite loop when parsing LSPs
   - Fix router capability TLV parsing issues

**vtysh**
   - New `show thread timers` command

**ospfd6**
   - Add LSA statistics to LSA database
   - Add LSA stats to `show area json` output
   - Show time left in hello timer for `show ipv6 ospf6 int`
   - Permit route deletion without nexthops
   - Restart SPF when distance is updated
   - Stop refreshing Type-5 from NSSA
   - Support keychain for ospf6 authentication

**ospfd**
   - New `show ip ospf reachable-routers` command
   - Restart SPF when distance is updated
   - Use consistent JSON keys for `show ip ospf neighbor` and detail version

**pimd**
   - Add additional IGMP stats
   - Add IGMP join sent/failed statistics
   - Add IGMP total groups and total source groups to statistics
   - New `debug igmp trace detail` command
   - New `ip pim passive` command
   - JSON support added for command `show ip igmp sources`
   - Allow the LPM match work properly with prefix lists and normal RP's
   - Do not allow 224.0.0.0/24 range in IGMP join
   - Fix IGMP packet/query check
   - Handle PIM join/prune receive flow for IPv6
   - Handle receive of (*,G) register stop with source address as 0
   - Handle of exclude mode IGMPv3 report messages for SSM-aware group
   - Handle of IGMPv2 report message for SSM-aware group range
   - Send immediate join with possible sg rpt prune bit set
   - Show group-type under `show ip pim rp-info`
   - Show total received messages IGMP stats

**staticd**
   - Capture zebra's advertised ECMP limit
   - Don't register existing nexthop to Zebra
   - Reject route config with too many nexthops
   - Track nexthops per-safi

**watchfrr**
   - Add some more information to `show watchfrr`
   - Send operational state to systemd

**zebra**
   - Add ability to know when FRR is not ASIC offloaded
   - Add command for setting protodown bit
   - Add dplane type for netconf data
   - Add ECMP supported to `show zebra`
   - Add EVPN status to `show zebra`
   - Add if v4/v6 forwarding is turned on/off to `show zebra`
   - Add initial zebra tracepoint support
   - Add kernel nexthop group support to `show zebra`
   - Add knowledge about ra and rfc 5549 to `show zebra`
   - Add mpls status to `show zebra`
   - Add netlink debug dump for netconf messages
   - Add netlink debugs for ip rules
   - Add OS and version to `show zebra`
   - Add support for end.dt4
   - Add to `show zebra` the type of vrf devices being used
   - Allow *BSD to specify a receive buffer size
   - Allow multiple connected routes to be choosen for kernel routes
   - Allow system routes to recurse through themselves
   - Don't send RAs w/o link-local v6 or on bridge-ports
   - Evpn disable remove l2vni from l3vni list
   - Evpn-mh bonds protodown check for set
   - Evpn-mh use protodown update reason api
   - Fix cleanup of meta queues on vrf disable
   - Fix crash in evpn neigh cleanup all
   - Fix missing delete vtep during vni transition
   - Fix missing vrf change of l2vni on vxlan interface
   - Fix rtadv startup when config read in is before interface up
   - Fix use after deletion event in FreeBSD
   - Fix v6 route replace failure turned into success
   - Get zebra graceful restart working when restarting on *BSD
   - Handle FreeBSD routing socket enobufs
   - Handle protodown netlink for vxlan device
   - Include mpls enabled status in interface output
   - Include old reason in evpn-mh bond update
   - Keep the interface flags safe on multiple ioctl calls
   - Let /32 host route with same ip cross vrf
   - Make router advertisement warnings show up once every 6 hours
   - Prevent crash if zebra_route_all is used for a route type
   - Prevent installation of connected multiple times
   - Protodown-up event trigger interface up
   - Register nht nexthops with proper safi
   - Update advertise-svi-ip macips w/ new mac
   - When handling unprocessed messages from kernel print usable string
   - New `show ip nht mrib` command
   - Handle ENOBUFS errors for FreeBSD

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agodebian, redhat: updating changelog for new release
Jafar Al-Gharaibeh [Sun, 17 Jul 2022 04:27:20 +0000 (23:27 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #11619 from FRRouting/mergify/bp/stable/8.3/pr-11604
Donald Sharp [Sun, 17 Jul 2022 00:58:32 +0000 (20:58 -0400)]
Merge pull request #11619 from FRRouting/mergify/bp/stable/8.3/pr-11604

ospfd: free unreachable router LSA node so that it is not left unreachable (backport #11604)

2 years agoMerge pull request #11620 from FRRouting/mergify/bp/stable/8.3/pr-11615
Donald Sharp [Sun, 17 Jul 2022 00:56:38 +0000 (20:56 -0400)]
Merge pull request #11620 from FRRouting/mergify/bp/stable/8.3/pr-11615

bgpd: Fix memory leak for community stuff (backport #11615)

2 years agoMerge pull request #11616 from FRRouting/mergify/bp/stable/8.3/pr-11614
Donald Sharp [Sun, 17 Jul 2022 00:56:12 +0000 (20:56 -0400)]
Merge pull request #11616 from FRRouting/mergify/bp/stable/8.3/pr-11614

bgpd: Fix memory leak for community alias (backport #11614)

2 years agobgpd: Fix memory leak for community stuff
Donatas Abraitis [Sat, 16 Jul 2022 13:26:13 +0000 (16:26 +0300)]
bgpd: Fix memory leak for community stuff

Do not forget to cleanup after we are done:

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

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

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

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

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

2 years agobgpd: Fix memory leak for community alias
Donatas Abraitis [Sat, 16 Jul 2022 13:18:07 +0000 (16:18 +0300)]
bgpd: Fix memory leak for community alias

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

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

2 years agoMerge pull request #11608 from FRRouting/mergify/bp/stable/8.3/pr-11606
Jafar Al-Gharaibeh [Fri, 15 Jul 2022 15:06:55 +0000 (10:06 -0500)]
Merge pull request #11608 from FRRouting/mergify/bp/stable/8.3/pr-11606

zebra: free neighbor state before exit to avoid memleaks (backport #11606)

2 years agozebra: free neighbor state before exit to avoid memleaks
Christian Hopps [Thu, 14 Jul 2022 16:20:01 +0000 (12:20 -0400)]
zebra: free neighbor state before exit to avoid memleaks

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 11c9ab3202b2cefca0daca2ca1883e6772524a73)

# Conflicts:
# zebra/zebra_neigh.c