]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
14 months agoMerge pull request #13059 from FRRouting/dev/mgmtd
Jafar Al-Gharaibeh [Wed, 22 Mar 2023 17:37:14 +0000 (12:37 -0500)]
Merge pull request #13059 from FRRouting/dev/mgmtd

Introduce the centralized management daemon

14 months agoMerge pull request #13075 from donaldsharp/bgp_route_debugs
Donatas Abraitis [Wed, 22 Mar 2023 10:47:35 +0000 (12:47 +0200)]
Merge pull request #13075 from donaldsharp/bgp_route_debugs

bgpd: Add vrf name and peer name to some bgp debugs

14 months agoMerge pull request #13080 from chiragshah6/fdev2
Donatas Abraitis [Wed, 22 Mar 2023 07:23:10 +0000 (09:23 +0200)]
Merge pull request #13080 from chiragshah6/fdev2

zebra: add evpn isDetectionFreeze to json output

14 months agolib: mgmtd: fix build warnings (as error)
Christian Hopps [Mon, 20 Mar 2023 23:28:42 +0000 (19:28 -0400)]
lib: mgmtd: fix build warnings (as error)

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agotests: apply frrbot style requirements
Christian Hopps [Mon, 20 Mar 2023 19:12:56 +0000 (15:12 -0400)]
tests: apply frrbot style requirements

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib: staticd: vtysh: apply frrbot style requirements
Christian Hopps [Mon, 20 Mar 2023 19:07:44 +0000 (15:07 -0400)]
lib: staticd: vtysh: apply frrbot style requirements

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib, mgmtd: Add few fixes for commit-check and rollback
Pushpasis Sarkar [Tue, 14 Mar 2023 10:36:06 +0000 (03:36 -0700)]
lib, mgmtd: Add few fixes for commit-check and rollback

This commit contains fixes for the following issues found
- 'mgmt commit check' issued through 'vtysh -f' was actually commtting the changeset.
- On config validation failure backend, mgmtd was not passing the correct error-reason
  to frontend.
- 'mgmt rollback ...' was reverting the change on backend, but config on mgmtd daemon
  remains intact

Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
14 months agomgmtd: lib: utilize msglib constructed from the removed code
Christian Hopps [Wed, 8 Mar 2023 22:11:43 +0000 (17:11 -0500)]
mgmtd: lib: utilize msglib constructed from the removed code

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib: new message library for mgmtd client and adapters
Christian Hopps [Wed, 8 Mar 2023 22:11:00 +0000 (17:11 -0500)]
lib: new message library for mgmtd client and adapters

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agostaticd: handle `distance` value
Christian Hopps [Tue, 28 Feb 2023 04:57:17 +0000 (23:57 -0500)]
staticd: handle `distance` value

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agotests: Add topotests for MGMT daemon
nguggarigoud [Fri, 29 Oct 2021 11:14:33 +0000 (04:14 -0700)]
tests: Add topotests for MGMT daemon

1. MGMT daemon support in topotests.
2. Sanity tests for MGMTd.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
14 months agozebra: add evpn isDetectionFreeze to json output
Sindhu Parvathi Gopinathan [Sat, 18 Mar 2023 18:48:34 +0000 (11:48 -0700)]
zebra: add evpn isDetectionFreeze to json output

Added "isDetectionFreeze" for show evpn json output to identify the
default and freeze permanent config.

Before fix:-
```
tor-2(config)# router bgp 65561
tor-2(config-router)# address-family l2vpn evpn
  <cr>
tor-2(config-router)# address-family l2vpn evpn
tor-2(config-router-af)# dup-addr-detection freeze permanent

tor-2(config-router-af)# do show evpn
L2 VNIs: 21
L3 VNIs: 5
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Advertise svi mac: No
Duplicate address detection: Enable
  Detection max-moves 5, time 180
  Detection freeze permanent
EVPN MH:
  mac-holdtime: 1080s, neigh-holdtime: 1080s
  startup-delay: 180s, start-delay-timer: --:--:--
  uplink-cfg-cnt: 0, uplink-active-cnt: 0
tor-2(config-router-af)#

tor-2(config-router-af)# do show evpn json
{
  "advertiseGatewayMacip":"No",
  "advertiseSviMacip":"No",
  "advertiseSviMac":"No",
  "numVnis":26,
  "numL2Vnis":21,
  "numL3Vnis":5,
  "isDuplicateAddrDetection":true,
  "maxMoves":5,
  "detectionTime":180,
  "detectionFreezeTime":0,
  "macHoldtime":1080,
  "neighHoldtime":1080,
  "startupDelay":180,
  "startupDelayTimer":"--:--:--",
  "uplinkConfigCount":0,
  "uplinkActiveCount":0
}
tor-2(config-router-af)#
```

After fix:-
```
cumulus@tor-1:mgmt:~$ sudo vtysh -c "show evpn json"
{
  "advertiseGatewayMacip":"No",
  "advertiseSviMacip":"No",
  "advertiseSviMac":"No",
  "numVnis":26,
  "numL2Vnis":21,
  "numL3Vnis":5,
  "isDuplicateAddrDetection":true,
  "maxMoves":5,
  "detectionTime":180,
  "detectionFreezeTime":0,  ==> default case , i.e dad_freeze duration is 0
  "isDetectionFreeze":false, ==> default case, i.e. dad_freeze disabled
  "macHoldtime":1080,
  "neighHoldtime":1080,
  "startupDelay":180,
  "startupDelayTimer":"--:--:--",
  "uplinkConfigCount":0,
  "uplinkActiveCount":0
}
cumulus@tor-1:mgmt:~$

tor-1(config-router-af)# dup-addr-detection freeze permanent
tor-1(config-router-af)# do show evpn json
{
  "advertiseGatewayMacip":"No",
  "advertiseSviMacip":"No",
  "advertiseSviMac":"No",
  "numVnis":26,
  "numL2Vnis":21,
  "numL3Vnis":5,
  "isDuplicateAddrDetection":true,
  "maxMoves":5,
  "detectionTime":180,
  "detectionFreezeTime":0, ==> dad_freeze with duration permanent
  "isDetectionFreeze":true, ==> dad_freeze enabled
  "macHoldtime":1080,
  "neighHoldtime":1080,
  "startupDelay":180,
  "startupDelayTimer":"00:00:08",
  "uplinkConfigCount":0,
  "uplinkActiveCount":0,
  "protodownReasons":[
    "startupDelay"
  ]
}
tor-1(config-router-af)#

tor-1(config-router-af)# dup-addr-detection freeze 400
tor-1(config-router-af)#
tor-1(config-router-af)# do show evpn json
{
  "advertiseGatewayMacip":"No",
  "advertiseSviMacip":"No",
  "advertiseSviMac":"No",
  "numVnis":26,
  "numL2Vnis":21,
  "numL3Vnis":5,
  "isDuplicateAddrDetection":true,
  "maxMoves":5,
  "detectionTime":180,
  "detectionFreezeTime":400, ==> dad_freeze duration with numeric value
  "isDetectionFreeze":true, ==> dad_freeze enabled
  "macHoldtime":1080,
  "neighHoldtime":1080,
  "startupDelay":180,
  "startupDelayTimer":"00:00:47",
  "uplinkConfigCount":0,
  "uplinkActiveCount":0,
  "protodownReasons":[
    "startupDelay"
  ]
}

tor-1(config-router-af)# no dup-addr-detection freeze permanent
tor-1(config-router-af)# do show evpn json
{
  "advertiseGatewayMacip":"No",
  "advertiseSviMacip":"No",
  "advertiseSviMac":"No",
  "numVnis":26,
  "numL2Vnis":21,
  "numL3Vnis":5,
  "isDuplicateAddrDetection":true,
  "maxMoves":5,
  "detectionTime":180,
  "detectionFreezeTime":0, ==> no dad_freeze duration
  "isDetectionFreeze":false, ==> no dad_freeze enabled
  "macHoldtime":1080,
  "neighHoldtime":1080,
  "startupDelay":180,
  "startupDelayTimer":"--:--:--",
  "uplinkConfigCount":0,
  "uplinkActiveCount":0
}
tor-1(config-router-af)#

```

Ticket:#3404283

Issue:3404283

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
14 months agodoc: Add documentation for MGMT daemon
Pushpasis Sarkar [Fri, 29 Oct 2021 17:22:42 +0000 (10:22 -0700)]
doc: Add documentation for MGMT daemon

This commit adds user documentation for the new MGMT daemon and
new FRR Management Framework.

Co-authored-by: Yash Ranjan <ranjany@vmware.com>
Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Co-authored-by: Ujwal P <ujwalp@vmware.com>
Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
14 months agomgmtd: Enroll Staticd as a backend client for MGMTD
Christian Hopps [Tue, 28 Feb 2023 09:08:41 +0000 (04:08 -0500)]
mgmtd: Enroll Staticd as a backend client for MGMTD

This commmit introduces Staticd as a backend client for the MGMTd
framework. All the static commands will be diverted to the MGMT
daemon and will use the transactional model to make changes to the
internal state. Similar mechanism can be used by other daemons to use
the MGMT framework in the future.

This commit includes the following functionalities in the changeset:
1. Diverts all the staticd (config only) commands to MGMTd.
2. Enrolls staticd as a backend client to use the MGMT framework.
3. Modify the staticd NB config handlers so that they can be compiled
   into a library and loaded in the MGMTd process context.

Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com>
Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Co-authored-by: Ujwal P <ujwalp@vmware.com>
Signed-off-by: Yash Ranjan <ranjany@vmware.com>
14 months agomgmtd: nb library for client front-end code
Christian Hopps [Tue, 28 Feb 2023 03:00:32 +0000 (22:00 -0500)]
mgmtd: nb library for client front-end code

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agomgmtd: Add MGMT Transaction Framework
Yash Ranjan [Thu, 28 Oct 2021 07:07:11 +0000 (00:07 -0700)]
mgmtd: Add MGMT Transaction Framework

This commit introduces the MGMT Transaction framework that takes
management requests from one (or more) frontend client sessions,
translates them into transactions and drives them to completion
in co-oridination with one (or more) backend client daemons
involved in the request.

This commit includes the following functionalities in the changeset:
1. Introduces the actual Transaction module. Commands added related to
   transaction are:
   a. show mgmt transaction all
2. Adds support for commit rollback feature which stores upto the 10
   commit buffers. Each commit has a commit-id which can be used to
   rollback to the exact configuration state.
   Commands supported for this feature are:
   a. show mgmt commit-history
   b. mgmt rollback commit-id COMMIT_ID
3. Add hidden commands to enable record various performance metrics:
   a. mgmt performance-measurement
   b. mgmt reset-statistic

Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com>
Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Co-authored-by: Ujwal P <ujwalp@vmware.com>
Signed-off-by: Yash Ranjan <ranjany@vmware.com>
14 months agomgmtd: Add MGMT Backend Interface Framework
Christian Hopps [Tue, 28 Feb 2023 15:00:19 +0000 (10:00 -0500)]
mgmtd: Add MGMT Backend Interface Framework

This commit introduces the MGMT Backend Interface which can be used
by back-end management client daemons like BGPd, Staticd, Zebra to
connect with new FRR Management daemon (MGMTd) and utilize the new
FRR Management Framework to let any Frontend clients to retrieve any
operational data or manipulate any configuration data owned by the
individual Backend daemon component.

This commit includes the following functionalities in the changeset:
1. Add new Backend server for Backend daemons connect to.
2. Add a C-based Backend client library which can be used by daemons
   to communicate with MGMTd via the Backend interface.
3. Maintain a backend adapter for each connection from an appropriate
   Backend client to facilitate client requests and track one or more
   transactions initiated from Frontend client sessions that involves
   the backend client component.
4. Add the following commands to inspect various Backend client
   related information
a. show mgmt backend-adapter all
b. show mgmt backend-yang-xpath-registry
        c. show mgmt yang-xpath-subscription

Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com>
Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Co-authored-by: Ujwal P <ujwalp@vmware.com>
Signed-off-by: Yash Ranjan <ranjany@vmware.com>
14 months agomgmtd: Add MGMT Frontend Interface Framework
Christian Hopps [Wed, 8 Mar 2023 22:26:38 +0000 (17:26 -0500)]
mgmtd: Add MGMT Frontend Interface Framework

This commit introduces the Frontend Interface which can be used
by front-end management clients like Netconf server, Restconf
Server and CLI to interact with new FRR Management daemon (MGMTd)
to access and sometimes modify FRR management data.

This commit includes the following functionalities in the changeset:
1. Add new Frontend server for clients connect to.
2. Add a C-based Frontend client library which can be used by Frontend
   clients to communicate with MGMTd via the Frontend interface.
3. Maintain a frontend adapter for each connection from an appropriate
   Frontend client to facilitate client requests and track one or more
   client sessions across it.
4. Define the protobuf message format for messages to be exchanged
   between MGMTd Frontend module and the Frontend client.
5. This changeset also introduces an instance of MGMT Frontend client
   embedded within the lib/vty module that can be leveraged by any FRR
   daemon to connect to MGMTd's Frontend interface. The same has been
   integrated with and initialized within the MGMTd daemon's process
   context to implement a bunch of 'set-config', 'commit-apply',
   'get-config' and 'get-data' commands via VTYSH

Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com>
Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Co-authored-by: Ujwal P <ujwalp@vmware.com>
Signed-off-by: Yash Ranjan <ranjany@vmware.com>
14 months agomgmtd: Bringup MGMTD daemon and datastore module support
Christian Hopps [Wed, 8 Mar 2023 22:22:09 +0000 (17:22 -0500)]
mgmtd: Bringup MGMTD daemon and datastore module support

Features added in this commit:
1. Bringup/shutdown new management daemon 'mgmtd' along with FRR.
2. Support for Startup, Candidate and Running DBs.
3. Lock/Unlock DS feature using pthread lock.
4. Load config from a JSON file onto candidate DS.
5. Save config to a JSON file from running/candidate DS.
6. Dump candidate or running DS contents on the terminal or a file in
   JSON/XML format.
7. Maintaining commit history (Full rollback support to be added in
   future commits).
8. Addition of debug commands.

Co-authored-by: Yash Ranjan <ranjany@vmware.com>
Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Co-authored-by: Ujwal P <ujwalp@vmware.com>
Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
14 months agoMerge pull request #13073 from donaldsharp/static_use_after_free
Rafael Zalamena [Tue, 21 Mar 2023 19:37:06 +0000 (16:37 -0300)]
Merge pull request #13073 from donaldsharp/static_use_after_free

staticd: Tell bfd that we are shutting down

14 months agobgpd: Add vrf name and peer name to some bgp debugs
Donald Sharp [Tue, 21 Mar 2023 19:06:00 +0000 (15:06 -0400)]
bgpd: Add vrf name and peer name to some bgp debugs

Some debugs were especially hard to figure out in bgp_route.c

a) If using a %p pointer to print the bgp_path_info this
is pretty useless.  Print where it came from instead
b) Use A.B.C.D/M(VRFNAME) when outputing the prefix

Just basically give more useful information.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #12997 from opensourcerouting/fix/free_duped_bgp_stuff_for_aggregate
Russ White [Tue, 21 Mar 2023 14:27:19 +0000 (10:27 -0400)]
Merge pull request #12997 from opensourcerouting/fix/free_duped_bgp_stuff_for_aggregate

bgpd: Free dup'ed attributes for aggregate routes with route-maps

14 months agoMerge pull request #12968 from pguibert6WIND/asn_aggregator_counter_prop
Russ White [Tue, 21 Mar 2023 14:12:01 +0000 (10:12 -0400)]
Merge pull request #12968 from pguibert6WIND/asn_aggregator_counter_prop

yang: Fix "aggregator-asn" to support asdot

14 months agostaticd: Tell bfd that we are shutting down
Donald Sharp [Tue, 21 Mar 2023 12:55:35 +0000 (08:55 -0400)]
staticd: Tell bfd that we are shutting down

Prevent a use after free and tell the bfd subsystem
we are shutting down in staticd.

./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460:==2264460==ERROR: AddressSanitizer: heap-use-after-free on address 0x61f000004698 at pc 0x7f65d1eb11b2 bp 0x7ffdbface490 sp 0x7ffdbface488
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-READ of size 4 at 0x61f000004698 thread T0
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #0 0x7f65d1eb11b1 in zclient_bfd_command lib/bfd.c:307
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #1 0x7f65d1eb20f5 in _bfd_sess_send lib/bfd.c:507
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #2 0x7f65d20510aa in thread_call lib/thread.c:1989
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #3 0x7f65d2051f0a in _thread_execute lib/thread.c:2081
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #4 0x7f65d1eb271b in _bfd_sess_remove lib/bfd.c:544
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #5 0x7f65d1eb278d in bfd_sess_free lib/bfd.c:553
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #6 0x7f65d1eb5400 in bfd_protocol_integration_finish lib/bfd.c:1029
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #7 0x7f65d1f42f77 in hook_call_frr_fini lib/libfrr.c:41
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #8 0x7f65d1f494a1 in frr_fini lib/libfrr.c:1199
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #9 0x563b7abefd76 in sigint staticd/static_main.c:70
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #10 0x7f65d200ef91 in frr_sigevent_process lib/sigevent.c:115
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #11 0x7f65d204fac6 in thread_fetch lib/thread.c:1758
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #12 0x7f65d1f49377 in frr_run lib/libfrr.c:1184
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #13 0x563b7abefed1 in main staticd/static_main.c:160
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #14 0x7f65d1b92d09 in __libc_start_main ../csu/libc-start.c:308
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #15 0x563b7abefa99 in _start (/usr/lib/frr/staticd+0x15a99)
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #12816 from gpnaveen/stc_rte_err_msg
Donatas Abraitis [Tue, 21 Mar 2023 11:30:08 +0000 (13:30 +0200)]
Merge pull request #12816 from gpnaveen/stc_rte_err_msg

tests: Enhance error msgs for static route automation.

14 months agoMerge pull request #13062 from Pdoijode/evpn-use-after-free-fix
Donatas Abraitis [Tue, 21 Mar 2023 11:04:25 +0000 (13:04 +0200)]
Merge pull request #13062 from Pdoijode/evpn-use-after-free-fix

zebra: Fix for heap-use-after-free in EVPN

14 months agoMerge pull request #13031 from opensourcerouting/ospf-show-database
Donald Sharp [Tue, 21 Mar 2023 11:03:05 +0000 (07:03 -0400)]
Merge pull request #13031 from opensourcerouting/ospf-show-database

ospfd: Improve the "show ip ospf database" command

14 months agoMerge pull request #13061 from donaldsharp/bfd_use_after_free
Donatas Abraitis [Tue, 21 Mar 2023 06:59:45 +0000 (08:59 +0200)]
Merge pull request #13061 from donaldsharp/bfd_use_after_free

lib: on bfd peer shutdown actually stop event

14 months agoMerge pull request #13064 from chiragshah6/fdev1
Donatas Abraitis [Tue, 21 Mar 2023 06:58:51 +0000 (08:58 +0200)]
Merge pull request #13064 from chiragshah6/fdev1

lib: fix clear route-map command

14 months agoMerge pull request #13063 from qlyoung/update-docker-build-info
Donatas Abraitis [Tue, 21 Mar 2023 06:56:20 +0000 (08:56 +0200)]
Merge pull request #13063 from qlyoung/update-docker-build-info

doc: add release instructions for docker images

14 months agolib:fix clear route-map cmd using DEFPY
Sindhu Parvathi Gopinathan [Mon, 20 Mar 2023 12:15:03 +0000 (05:15 -0700)]
lib:fix clear route-map cmd using DEFPY

Due to the wrong input argv id, "argv[idx_word]->arg"
fetched in-correctly and it clears all the route-maps instead of
specific one.

Now correct argv id is passed to clear the given route-map counters.

Also, use RMAP_NAME which allows to show list of configured
route-maps in the system.

After Fix:-

Ticket:#3407773
Issue:3407773

Testing: UT done

Before:
TORC11# clear route-map counters
  <cr>
  WORD  route-map name

After:

TORC11# clear route-map counters
  <cr>
  RMAP_NAME  route-map name
     my-as

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
14 months agodoc: add release instructions for docker images
Quentin Young [Mon, 20 Mar 2023 20:54:20 +0000 (16:54 -0400)]
doc: add release instructions for docker images

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
14 months agoMerge pull request #12688 from dorDiogo/isis_hello_padding_sometimes
Russ White [Mon, 20 Mar 2023 21:00:57 +0000 (17:00 -0400)]
Merge pull request #12688 from dorDiogo/isis_hello_padding_sometimes

isisd: Add support for IS-IS hello padding during-adjacency-formation

14 months agolib: on bfd peer shutdown actually stop event
Donald Sharp [Mon, 20 Mar 2023 20:07:20 +0000 (16:07 -0400)]
lib: on bfd peer shutdown actually stop event

When deleting a bfd peer during shutdown, let's ensure
that any scheduled events are actually stopped.

==7759== Invalid read of size 4
==7759==    at 0x48BF700: _bfd_sess_valid (bfd.c:419)
==7759==    by 0x48BF700: _bfd_sess_send (bfd.c:470)
==7759==    by 0x492F79C: thread_call (thread.c:2008)
==7759==    by 0x48E9BD7: frr_run (libfrr.c:1223)
==7759==    by 0x1C739B: main (bgp_main.c:550)
==7759==  Address 0xfb687a4 is 4 bytes inside a block of size 272 free'd
==7759==    at 0x48369AB: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==7759==    by 0x48BFA5A: bfd_sess_free (bfd.c:535)
==7759==    by 0x2B7034: bgp_peer_remove_bfd (bgp_bfd.c:339)
==7759==    by 0x29FF8A: peer_free (bgpd.c:1160)
==7759==    by 0x29FF8A: peer_unlock_with_caller (bgpd.c:1192)
==7759==    by 0x2A0506: peer_delete (bgpd.c:2633)
==7759==    by 0x208190: bgp_stop (bgp_fsm.c:1639)
==7759==    by 0x20C082: bgp_event_update (bgp_fsm.c:2751)
==7759==    by 0x492F79C: thread_call (thread.c:2008)
==7759==    by 0x48E9BD7: frr_run (libfrr.c:1223)
==7759==    by 0x1C739B: main (bgp_main.c:550)
==7759==  Block was alloc'd at
==7759==    at 0x4837B65: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==7759==    by 0x48F53AF: qcalloc (memory.c:116)
==7759==    by 0x48BF98D: bfd_sess_new (bfd.c:397)
==7759==    by 0x2B76DC: bgp_peer_configure_bfd (bgp_bfd.c:298)
==7759==    by 0x2B76DC: bgp_peer_configure_bfd (bgp_bfd.c:279)
==7759==    by 0x29BA06: peer_group2peer_config_copy (bgpd.c:2803)
==7759==    by 0x2A3D96: peer_create_bind_dynamic_neighbor (bgpd.c:4107)
==7759==    by 0x2A4195: peer_lookup_dynamic_neighbor (bgpd.c:4239)
==7759==    by 0x21AB72: bgp_accept (bgp_network.c:422)
==7759==    by 0x492F79C: thread_call (thread.c:2008)
==7759==    by 0x48E9BD7: frr_run (libfrr.c:1223)
==7759==    by 0x1C739B: main (bgp_main.c:550)

tl;dr -> Effectively, in this test setup we have 300 dynamic bgp
sessions all of which are using bfd.  When a peer collision is detected
or we remove the peers, if an event has been scheduled but not actually
executed yet the event event was not actually being stopped, leaving
the bsp pointer on the thread->arg and causing a crash when it is
executed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Fix for heap-use-after-free in EVPN
Pooja Jagadeesh Doijode [Mon, 20 Mar 2023 19:54:31 +0000 (12:54 -0700)]
zebra: Fix for heap-use-after-free in EVPN

Issue:
When a netns is deleted, since zebra doesnā€™t receive interface down/delete
notifications from kernel, it manually deletes the interface without removing
the association between zebra_l3vni and the interface that is being deleted
(i.e it deletes the interface without setting ā€œzl3vni->vxlan_ifā€ to NULL).

Later, during the deletion of netns, when zl3vni_rmac_uninstall() is called to
uninstall the remote RMAC from the kernel, zebra ends up accessing stale
ā€œzl3vni->vxlan_ifā€ pointer, which now points to freed memory.
This was causing heap use-after-free.

Fix:
Before zebra starts deleting the interfaces when it receives netns delete notification,
appropriate functions() are being called to remove the association between evpn structs
and interface and set ā€œzl3vni->vxlan_ifā€ to NULL. This ensures that when
zl3vni_rmac_uninstall() is called during netns deletion, it will bail because
ā€œzl3vni->vxlan_ifā€ is NULL.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
14 months agoMerge pull request #13050 from opensourcerouting/fix/update_snmp_mibs_doc
Donald Sharp [Sun, 19 Mar 2023 22:40:08 +0000 (18:40 -0400)]
Merge pull request #13050 from opensourcerouting/fix/update_snmp_mibs_doc

14 months agoMerge pull request #13049 from opensourcerouting/fix/missed_ipv6_prefix-list_any
Donald Sharp [Sun, 19 Mar 2023 22:38:38 +0000 (18:38 -0400)]
Merge pull request #13049 from opensourcerouting/fix/missed_ipv6_prefix-list_any

14 months agoMerge pull request #13047 from opensourcerouting/nhrpd-memleak-20230319
Donald Sharp [Sun, 19 Mar 2023 22:35:57 +0000 (18:35 -0400)]
Merge pull request #13047 from opensourcerouting/nhrpd-memleak-20230319

14 months agodoc: Use frrouting/frr-mibs repo downloading SNMP mibs
Donatas Abraitis [Sun, 19 Mar 2023 20:56:13 +0000 (22:56 +0200)]
doc: Use frrouting/frr-mibs repo downloading SNMP mibs

Use repo instead of pastebin.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agolib: Destroy `any` flag when creating a prefix-list entry with prefix
Donatas Abraitis [Sun, 19 Mar 2023 20:46:56 +0000 (22:46 +0200)]
lib: Destroy `any` flag when creating a prefix-list entry with prefix

The same as 61c07b9d43529f69f48ca54f4f0213cff52b5d0a, but forgot to put IPv6
in place.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agotests: Check if prefix-lists with IPv6 any works fine
Donatas Abraitis [Sun, 19 Mar 2023 20:46:35 +0000 (22:46 +0200)]
tests: Check if prefix-lists with IPv6 any works fine

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agonhrpd: drop peer references on freeing cache entry
David Lamparter [Sun, 19 Mar 2023 11:38:49 +0000 (12:38 +0100)]
nhrpd: drop peer references on freeing cache entry

When dropping an interface (e.g. at shutdown) while there are still
valid cache entries, the reference held on the cache entries' peer
pointers was leaking.

Fixes: #12505
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
14 months agoMerge pull request #13025 from donaldsharp/ospf_ti_lfa_leaks
Jafar Al-Gharaibeh [Sun, 19 Mar 2023 04:44:37 +0000 (23:44 -0500)]
Merge pull request #13025 from donaldsharp/ospf_ti_lfa_leaks

Ospf ti lfa leaks

14 months agoMerge pull request #13026 from chiragshah6/fdev1
Jafar Al-Gharaibeh [Sun, 19 Mar 2023 04:42:32 +0000 (23:42 -0500)]
Merge pull request #13026 from chiragshah6/fdev1

pbrd:fix mismatching in match src-dst

14 months agoMerge pull request #13038 from donaldsharp/ospf_apiserver_memleaks
Jafar Al-Gharaibeh [Sun, 19 Mar 2023 04:28:46 +0000 (23:28 -0500)]
Merge pull request #13038 from donaldsharp/ospf_apiserver_memleaks

ospfd: Cleanup some memory leaks on shutdown in ospf_apiserver.c

14 months agoospfd: Cleanup some memory leaks on shutdown in ospf_apiserver.c
Donald Sharp [Sat, 18 Mar 2023 19:35:34 +0000 (15:35 -0400)]
ospfd: Cleanup some memory leaks on shutdown in ospf_apiserver.c

Clean up some memory leaks found in ospf_apiserver.c  Also
a crash in the original implementation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #13023 from opensourcerouting/mld-expire-off
Donald Sharp [Sat, 18 Mar 2023 11:32:09 +0000 (07:32 -0400)]
Merge pull request #13023 from opensourcerouting/mld-expire-off

pimd: stop t_sg_expire in MLD NOINFO transition

14 months agoMerge pull request #13024 from opensourcerouting/fix/bgpd_prefix-list_changes_not_aff...
Donald Sharp [Sat, 18 Mar 2023 11:31:12 +0000 (07:31 -0400)]
Merge pull request #13024 from opensourcerouting/fix/bgpd_prefix-list_changes_not_affected

lib: Adjust only any flag for prefix-list entries if destroying

14 months agoMerge pull request #13027 from donaldsharp/evpn_crashit_like_you_wantit
Donatas Abraitis [Sat, 18 Mar 2023 08:22:33 +0000 (10:22 +0200)]
Merge pull request #13027 from donaldsharp/evpn_crashit_like_you_wantit

bgpd: Prevent Null pointer deref when outputting data

14 months agoospfd: Fix inconsistency in LSDB JSON output
Renato Westphal [Sat, 18 Mar 2023 01:48:59 +0000 (22:48 -0300)]
ospfd: Fix inconsistency in LSDB JSON output

As it can be seen below, the LSDB JSON output varies depending
whether a filter option is specified or not (e.g. "adv-router",
"self-originate"):

> show ip ospf database router json
{
  "routerId":"3.3.3.3",
  "routerLinkStates":{
    "areas":{
      "0.0.0.0":[
        {
          "lsaAge":175,
          "options":"*|-|-|-|-|-|E|-",
          [snip]

> show ip ospf database router adv-router 2.2.2.2 json
{
  "routerId":"3.3.3.3",
  "Router Link States":{
    "0.0.0.0":{
      "2.2.2.2":{
        "lsaAge":193,
        "options":"*|-|-|-|-|-|E|-",
        [snip]

This inconsistency is undesirable since it makes this data harder to
consume programmatically. Also, in the second output, "Router Link
States" is used as a JSON key, which doesn't conform to our JSON
guidelines (JSON keys need to be camelCased).

Make the required changes to ensure the first output structure is used,
regardless if any output filter is used or not.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
14 months agoospfd: Add "detail" option to "show ip ospf database"
Renato Westphal [Sat, 18 Mar 2023 01:48:59 +0000 (22:48 -0300)]
ospfd: Add "detail" option to "show ip ospf database"

This option is useful to dump detailed information about the LSDB using
a single command (instead of one command per LSA type).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
14 months agoospfd: Refactor the "show ip ospf database" command
Renato Westphal [Sat, 18 Mar 2023 01:48:59 +0000 (22:48 -0300)]
ospfd: Refactor the "show ip ospf database" command

Combine all variations of this command into a single DEFPY to
improve maintainability. No behavioral changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
14 months agopbrd:fix mismatching in match src-dst
Chirag Shah [Fri, 17 Mar 2023 04:47:07 +0000 (21:47 -0700)]
pbrd:fix mismatching in match src-dst

upstream commit 67765a232d has incorect
address family check which prevent from
deleting src/dst config under pbr rule.

Ticket:#3405024
Issue:3405024
Testing Done:

Config:

pbr-map map6 seq 1
 match src-ip 2000::200:100:100:0/96
 match dst-ip 2000::100:100:100:0/96
 set nexthop-group group3

Before:
torc-12(config)# pbr-map map6 seq 1
torc-12(config-pbr-map)# no match src-ip 2000::200:100:100:0/96
Cannot mismatch families within match src/dst

After:
torc-12(config)# pbr-map map6 seq 1
torc-12(config-pbr-map)# no match src-ip 2000::200:100:100:0/96
torc-12(config-pbr-map)#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
14 months agobgpd: Prevent Null pointer deref when outputting data
Donald Sharp [Fri, 17 Mar 2023 19:40:33 +0000 (15:40 -0400)]
bgpd: Prevent Null pointer deref when outputting data

Crash:

(gdb) bt
0  0x00007fee27de15cb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007fee280ecd9c in core_handler (signo=11, siginfo=0x7ffe56001bb0, context=<optimized out>) at lib/sigevent.c:264
2  <signal handler called>
3  0x0000555e321c41b2 in prefix_rd2str (prd=0x10, buf=buf@entry=0x7ffe56002080 "27.0.0.R\340\373\062\062^U", size=size@entry=28) at bgpd/bgp_rd.c:168
4  0x0000555e321c431a in printfrr_prd (buf=0x7ffe560021a0, ea=<optimized out>, ptr=<optimized out>) at bgpd/bgp_rd.c:224
5  0x00007fee2812069b in vbprintfrr (cb_in=cb_in@entry=0x7ffe56002330, fmt0=fmt0@entry=0x555e3229a3ad " RD: %pRD\n", ap=ap@entry=0x7ffe560023d8) at lib/printf/vfprintf.c:564
6  0x00007fee28122ef7 in vasnprintfrr (mt=mt@entry=0x7fee281cb5e0 <MTYPE_VTY_OUT_BUF>, out=out@entry=0x7ffe560023f0 " RD: : R\n", outsz=outsz@entry=1024, fmt=fmt@entry=0x555e3229a3ad " RD: %pRD\n", ap=ap@entry=0x7ffe560023d8) at lib/printf/glue.c:103
7  0x00007fee28103504 in vty_out (vty=vty@entry=0x555e33f82d10, format=format@entry=0x555e3229a3ad " RD: %pRD\n") at lib/vty.c:190
8  0x0000555e32185156 in bgp_evpn_es_show_entry_detail (vty=0x555e33f82d10, es=0x555e33c38420, json=<optimized out>) at bgpd/bgp_evpn_mh.c:2655
9  0x0000555e32188fe5 in bgp_evpn_es_show (vty=vty@entry=0x555e33f82d10, uj=false, detail=true) at bgpd/bgp_evpn_mh.c:2721
notice prd=0x10 in #3.  This is because in bgp_evpn_mh.c we are sending &es->es_base_frag->prd.

There is one spot in the code where during output the es->es_base_frag is checked for non nullness
Let's just make sure it's right in all the places.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #13019 from rgirada/ospf_type3_fix
Renato Westphal [Fri, 17 Mar 2023 16:04:43 +0000 (13:04 -0300)]
Merge pull request #13019 from rgirada/ospf_type3_fix

ospfd: Ospf ABR doesnt Advertise LSA summary

14 months agoMerge pull request #13005 from donaldsharp/prefix_list_speedup
Russ White [Fri, 17 Mar 2023 15:19:38 +0000 (11:19 -0400)]
Merge pull request #13005 from donaldsharp/prefix_list_speedup

lib: Speedup prefix-list readin by a large factor

14 months agoospfd: Free up q_space in early return path
Donald Sharp [Fri, 17 Mar 2023 14:58:08 +0000 (10:58 -0400)]
ospfd: Free up q_space in early return path

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoospfd: Fix ospf_ti_lfa drop of an entire table
Donald Sharp [Fri, 17 Mar 2023 14:37:40 +0000 (10:37 -0400)]
ospfd: Fix ospf_ti_lfa drop of an entire table

The new_rtrs variable was just generated and then dropped.  Let's
fix that entirely

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agolib: Adjust only `any` flag for prefix-list entries if destroying
Donatas Abraitis [Fri, 17 Mar 2023 12:48:35 +0000 (14:48 +0200)]
lib: Adjust only `any` flag for prefix-list entries if destroying

Before this patch, if we destroy `any` flag for a prefix-list entry, we always
set destination as 0.0.0.0/0 and/or ::/0.

This means that, if we switch from `ip prefix-list r1-2 seq 5 deny any` to
`ip prefix-list r1-2 seq 5 permit 10.10.10.10/32` we will have
`permit any` eventually, which broke ACLs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agotests: Check if route-map works correctly if modifying prefix-lists
Donatas Abraitis [Thu, 16 Mar 2023 12:39:40 +0000 (14:39 +0200)]
tests: Check if route-map works correctly if modifying prefix-lists

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agopimd: stop t_sg_expire in MLD NOINFO transition
David Lamparter [Fri, 17 Mar 2023 12:34:46 +0000 (13:34 +0100)]
pimd: stop t_sg_expire in MLD NOINFO transition

When hitting gm_sg_update from the S,G expiry timer, t_sg_expire will
already be cancelled.  But when arriving there from e.g. the MLD packet
getting cleared out, it'll still be running.

Clear out the timer if we arrive with `has_expired == true`.

Fixes: #12441
Reported-by: Vijay Kumar Gupta <vijayg@vmware.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
14 months agoMerge pull request #13016 from opensourcerouting/feature/ospf_logging_upstream_backport
Donald Sharp [Fri, 17 Mar 2023 11:55:09 +0000 (07:55 -0400)]
Merge pull request #13016 from opensourcerouting/feature/ospf_logging_upstream_backport

ospfd, ospfd6: Add more logging

14 months agoospfd: Ospf ABR doesnt Advertise LSA summary
rgirada [Fri, 17 Mar 2023 09:17:39 +0000 (09:17 +0000)]
ospfd: Ospf ABR doesnt Advertise LSA summary

Description:
OSPF ABR will summarise the networks based on configured range
and re-advtertise the summarised route. But if configured range
prefix id is same as one of the subset of routes prefix id then
as per rcf2328 Appendex-E recommendation, it will prepare the LSID and originate.
While re-advertising, it is using ospf LSDB instead of area specific
LSDB which is making it fail to re-advertise the summary lsa.
Fixed this by passing correct LSDB pointer.

Issue: #12995

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
14 months agoMerge pull request #13012 from donaldsharp/hold_time_reset
Donatas Abraitis [Fri, 17 Mar 2023 10:04:28 +0000 (12:04 +0200)]
Merge pull request #13012 from donaldsharp/hold_time_reset

bgpd: Always restart timer from scratch in OpenConfirm/Established

14 months agoospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor ID
Martin Winter [Wed, 26 Oct 2022 15:17:01 +0000 (08:17 -0700)]
ospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor ID

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoospfd, ospf6d: Add more logging details
Donatas Abraitis [Wed, 6 Apr 2022 19:15:57 +0000 (22:15 +0300)]
ospfd, ospf6d: Add more logging details

Basically just router-id or interface/IP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #13009 from donaldsharp/nexthop_use_interface_name
Donatas Abraitis [Fri, 17 Mar 2023 07:56:00 +0000 (09:56 +0200)]
Merge pull request #13009 from donaldsharp/nexthop_use_interface_name

bgpd: Use interface name instead of pointer value

14 months agobgpd: Always restart timer from scratch in OpenConfirm/Established
Donald Sharp [Thu, 16 Mar 2023 23:19:04 +0000 (19:19 -0400)]
bgpd: Always restart timer from scratch in OpenConfirm/Established

Imagine this scenario:

A peer has very large hold/keepalive timers of 600/200.  This peer is
using the DataCenter default time.  As such the open will cause
the t_holdtime to be negotiated to 600 seconds.  Now also imagine
that both peers are in update-delay.  If we do not restart the
timers and both peers are in Update Delay, we will continously
reset the peer because the hold time will be hit( since the peer
is not sending us any data ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #12999 from opensourcerouting/fix/bgp_leaks_random_stuff
Donald Sharp [Thu, 16 Mar 2023 23:12:55 +0000 (19:12 -0400)]
Merge pull request #12999 from opensourcerouting/fix/bgp_leaks_random_stuff

bgpd: aggregate routes memory leak for aspath

14 months agolib: Speedup prefix-list readin by a large factor
Donald Sharp [Wed, 15 Mar 2023 17:51:19 +0000 (13:51 -0400)]
lib: Speedup prefix-list readin by a large factor

Reading in prefix-lists is reading in the specified
prefix list and validating that the prefix is unique
2 times.  This makes no sense.  Relax the requirement
that a prefix list can limit this as well as completely
remove this check.  Validation then just becomes
does this prefix-list specified actually make sense
and that is taken care of by the the cli code.

Reading in prefix-lists was looking for duplicate prefixes
2 times instead of doing it just one time.  Let's just
not do it at all.

By doing this change, The code changes from never
completing for a 27k long prefix-list to taking
just under 30 seconds, with 4 daemons processing
this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agobgpd: Use interface name instead of pointer value
Donald Sharp [Thu, 16 Mar 2023 14:24:25 +0000 (10:24 -0400)]
bgpd: Use interface name instead of pointer value

Log message is borked in a manner that makes it unusable:
bgpd[52]: [VX6SM-8YE5W][EC 33554460] 2000:31:0:53::2: nexthop_set failed, resetting connection - intf 0x561eb9005a30

Let's print out the interface name instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #13006 from opensourcerouting/bgp-gr-null-warning
Donald Sharp [Thu, 16 Mar 2023 11:41:10 +0000 (07:41 -0400)]
Merge pull request #13006 from opensourcerouting/bgp-gr-null-warning

bgpd: fix NULL argument warning

14 months agobgpd: fix NULL argument warning
David Lamparter [Thu, 16 Mar 2023 10:00:02 +0000 (11:00 +0100)]
bgpd: fix NULL argument warning

gcc 12.2.0 complains `error: ā€˜%sā€™ directive argument is null`, even
though all enum values are covered with a string.  Let's just go with a
`???` default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
14 months agoyang, bgpd: Fix "aggregator-asn" to support asdot
anlan_cs [Thu, 9 Mar 2023 01:34:07 +0000 (09:34 +0800)]
yang, bgpd: Fix "aggregator-asn" to support asdot

The following command is not working:

 > (routemap)  set aggregator as ASNUM A.B.C.D

Since "aggregator-asn" has already supported asdot,
fixed it with new yang type. Extra ASN validation
(leading zeroes for instance) are done in the validate
hook of the yang leaf.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agoMerge pull request #13002 from opensourcerouting/fix/missing_bgp_dest_unlock_node_lea...
Donald Sharp [Thu, 16 Mar 2023 01:54:15 +0000 (21:54 -0400)]
Merge pull request #13002 from opensourcerouting/fix/missing_bgp_dest_unlock_node_leak_update

14 months agoMerge pull request #12998 from opensourcerouting/clippy-python-init-api
Mark Stapp [Wed, 15 Mar 2023 15:33:35 +0000 (11:33 -0400)]
Merge pull request #12998 from opensourcerouting/clippy-python-init-api

lib: adapt clippy to Python 3.8+ init API

14 months agolib: adapt clippy to Python 3.8+ init API
David Lamparter [Wed, 15 Mar 2023 11:24:36 +0000 (12:24 +0100)]
lib: adapt clippy to Python 3.8+ init API

The old initialization/config API is deprecated in Python 3.11.  Make
clippy use the new one added in 3.8 if it's that version or newer.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
14 months agobgpd: Unlock bgp dest node if leak_update() fails
Donatas Abraitis [Wed, 15 Mar 2023 12:52:21 +0000 (14:52 +0200)]
bgpd: Unlock bgp dest node if leak_update() fails

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12982 from opensourcerouting/fix/commmitlint_condition
Mark Stapp [Wed, 15 Mar 2023 12:20:48 +0000 (08:20 -0400)]
Merge pull request #12982 from opensourcerouting/fix/commmitlint_condition

tools: Use specific syntax for conditions for Github actions

14 months agobgpd: Free previously dup'ed aspath attribute for aggregate routes
Donatas Abraitis [Wed, 15 Mar 2023 11:31:58 +0000 (13:31 +0200)]
bgpd: Free previously dup'ed aspath attribute for aggregate routes

Fixes memory leak:

```
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233:Direct leak of 80 byte(s) in 2 object(s) allocated f
rom:
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    0 0x7fcce641b037 in __interceptor_calloc ../../
../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    1 0x7fcce601f874 in qcalloc lib/memory.c:105
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    2 0x55a9594c805e in aspath_dup bgpd/bgp_aspath.c:688
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    3 0x55a9594cf55b in bgp_aggr_aspath_prepare bgpd/bgp_aspath.c:2164
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    4 0x7fcce5fbc95a in hash_iterate lib/hash.c:252
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    5 0x55a9594cf82f in bgp_compute_aggregate_aspath_val bgpd/bgp_aspath.c:2223
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    6 0x55a9594cf5db in bgp_compute_aggregate_aspath bgpd/bgp_aspath.c:2179
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    7 0x55a9592740fb in bgp_add_route_to_aggregate bgpd/bgp_route.c:8035
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    8 0x55a9592750ec in bgp_aggregate_increment bgpd/bgp_route.c:8234
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    9 0x55a959263174 in bgp_update bgpd/bgp_route.c:4797
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    10 0x55a9592696c9 in bgp_nlri_parse_ip bgpd/bgp_route.c:6070
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    11 0x55a959210649 in bgp_nlri_parse bgpd/bgp_packet.c:339
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    12 0x55a95921a3a1 in bgp_update_receive bgpd/bgp_packet.c:2023
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    13 0x55a95922159b in bgp_process_packet bgpd/bgp_packet.c:2933
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    14 0x7fcce60eaa50 in thread_call lib/thread.c:1991
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    15 0x7fcce5fe2e54 in frr_run lib/libfrr.c:1185
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    16 0x55a9590d256d in main bgpd/bgp_main.c:505
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Unlock dest if we return earlier for aggregate install
Donatas Abraitis [Mon, 13 Mar 2023 20:26:09 +0000 (22:26 +0200)]
bgpd: Unlock dest if we return earlier for aggregate install

If the bgp is in shutdown state or so, do not forget to unlock the dest node.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Free dup'ed attributes for aggregate routes with route-maps
Donatas Abraitis [Wed, 15 Mar 2023 09:35:00 +0000 (11:35 +0200)]
bgpd: Free dup'ed attributes for aggregate routes with route-maps

If route-map deny match is returned, we should free previously dup'ed
attributes: aspath, community, large community, extended community.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12996 from chiragshah6/fdev1
Donatas Abraitis [Wed, 15 Mar 2023 08:21:02 +0000 (10:21 +0200)]
Merge pull request #12996 from chiragshah6/fdev1

tools: frr-reload fix list value not present

14 months agoMerge pull request #12310 from kuldeepkash/pim_v6
Donatas Abraitis [Wed, 15 Mar 2023 06:55:24 +0000 (08:55 +0200)]
Merge pull request #12310 from kuldeepkash/pim_v6

tests: [PIMv6] Adding multicast pim6 SM testsuite

14 months agotools: frr-reload fix list value not present
Chirag Shah [Wed, 15 Mar 2023 04:32:40 +0000 (21:32 -0700)]
tools: frr-reload fix list value not present

Check for value present in list before removing
as in certain python3 ValueError traceback is observed.

Traceback (most recent call last):
  File "/usr/lib/frr/frr-reload.py",
line 2278, in <module>
    (lines_to_add, lines_to_del, restart_frr)
= compare_context_objects(newconf, running)
  File "/usr/lib/frr/frr-reload.py",
line 1933, in compare_context_objects
    lines_to_add, lines_to_del
  File "/usr/lib/frr/frr-reload.py",
line 1549, in ignore_delete_re_add_lines
    lines_to_del.remove((ctx_keys, line))
ValueError: list.remove(x): x not in list

Ticket:#3389979
Issue:3389979

Testing Done:
With fix perform frr-relaod on frr.conf config where earlier
traceback was seen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
14 months agoMerge pull request #12936 from opensourcerouting/ospf6d-out-filter-list
Russ White [Tue, 14 Mar 2023 15:33:44 +0000 (11:33 -0400)]
Merge pull request #12936 from opensourcerouting/ospf6d-out-filter-list

ospfd: correctly update outbound filter-list once prefix-list is updated

14 months agoMerge pull request #12990 from opensourcerouting/fix/rename_bgp_afi_node_lookup
Russ White [Tue, 14 Mar 2023 14:16:16 +0000 (10:16 -0400)]
Merge pull request #12990 from opensourcerouting/fix/rename_bgp_afi_node_lookup

bgpd: Drop afi from lookup functions (not used)

14 months agoMerge pull request #12989 from opensourcerouting/fix/memory_leaks_bgpd
Russ White [Tue, 14 Mar 2023 14:15:07 +0000 (10:15 -0400)]
Merge pull request #12989 from opensourcerouting/fix/memory_leaks_bgpd

bgpd: Free memory allocated by ecommunity_ecom2str()

14 months agoMerge pull request #12979 from miegl/isis_tun
Russ White [Tue, 14 Mar 2023 14:05:01 +0000 (10:05 -0400)]
Merge pull request #12979 from miegl/isis_tun

isisd: IS-IS over tunnel (GRE, GENEVE)

14 months agoMerge pull request #12965 from donaldsharp/gr_vrf_aware
Russ White [Tue, 14 Mar 2023 12:45:02 +0000 (08:45 -0400)]
Merge pull request #12965 from donaldsharp/gr_vrf_aware

zebra: Make GR debug logs at least vrf aware

14 months agoMerge pull request #12922 from opensourcerouting/ospf-gr-fixes
Russ White [Tue, 14 Mar 2023 12:38:36 +0000 (08:38 -0400)]
Merge pull request #12922 from opensourcerouting/ospf-gr-fixes

OSPF Graceful Restart fixes

14 months agobgpd: Drop afi_t from bgp_evpn_global_node_lookup()
Donatas Abraitis [Tue, 14 Mar 2023 10:05:58 +0000 (12:05 +0200)]
bgpd: Drop afi_t from bgp_evpn_global_node_lookup()

Not used.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup()
Donatas Abraitis [Tue, 14 Mar 2023 10:01:56 +0000 (12:01 +0200)]
bgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup()

afi not used in this function, reduce a bit.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Free memory allocated by ecommunity_ecom2str()
Donatas Abraitis [Tue, 14 Mar 2023 09:03:53 +0000 (11:03 +0200)]
bgpd: Free memory allocated by ecommunity_ecom2str()

Return local string, copied from returned value of ecom2str.

```
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690:Direct leak of 528 byte(s) in 8 object(s) allocated from:
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    0 0x7efcde5d6037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    1 0x7efcde1dc7e2 in qcalloc lib/memory.c:105
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    2 0x5628a0592704 in ecommunity_ecom2str bgpd/bgp_ecommunity.c:947
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    3 0x7efcdaa558c8 in mplsL3vpnVrfRtTable bgpd/bgp_mplsvpn_snmp.c:1152
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    4 0x7efcda784139 in netsnmp_old_api_helper helpers/old_api.c:332
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-SUMMARY: AddressSanitizer: 528 byte(s) leaked in 8 allocation(s).
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12978 from donaldsharp/multicast_address
mobash-rasool [Tue, 14 Mar 2023 05:48:35 +0000 (11:18 +0530)]
Merge pull request #12978 from donaldsharp/multicast_address

pimd: IN_MULTICAST needs host order

14 months agotools: Use specific syntax for conditions for Github actions
Donatas Abraitis [Mon, 13 Mar 2023 07:52:13 +0000 (09:52 +0200)]
tools: Use specific syntax for conditions for Github actions

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12974 from donaldsharp/update_versioning
Donatas Abraitis [Sun, 12 Mar 2023 19:48:49 +0000 (21:48 +0200)]
Merge pull request #12974 from donaldsharp/update_versioning

bgpd: Increment version number even when no data is sent

14 months agoisisd: pfpacket BPF filter with IS-IS over tunnel support
Josef Miegl [Sun, 12 Mar 2023 15:15:27 +0000 (16:15 +0100)]
isisd: pfpacket BPF filter with IS-IS over tunnel support

Signed-off-by: Josef Miegl <josef@miegl.cz>
14 months agoMerge pull request #12923 from donaldsharp/update_group_debug
Donatas Abraitis [Sun, 12 Mar 2023 13:51:51 +0000 (15:51 +0200)]
Merge pull request #12923 from donaldsharp/update_group_debug

bgpd: Add missing items to debug for update group hash key creation

14 months agopimd: IN_MULTICAST needs host order
Donald Sharp [Sun, 12 Mar 2023 00:37:21 +0000 (19:37 -0500)]
pimd: IN_MULTICAST needs host order

New correct behavior:

eva# conf
eva(config)# ip pim rp 192.168.1.224 224.0.0.0/24
No Path to RP address specified: 192.168.1.224
eva(config)# ip pim rp 224.1.2.3 224.0.0.0/24
% Bad RP address specified: 224.1.2.3
eva(config)#

Fixes: #12970
Signed-off-by: Donald Sharp <sharpd@nvidia.com>