]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
8 months agozebra: Expose rib_update_handle_vrf_all
Donald Sharp [Fri, 7 Jun 2024 16:56:35 +0000 (12:56 -0400)]
zebra: Expose rib_update_handle_vrf_all

This function will be used on interface down
events to allow for kernel routes to be cleaned
up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Make p and src_p const for rib_delete
Donald Sharp [Fri, 7 Jun 2024 16:30:59 +0000 (12:30 -0400)]
zebra: Make p and src_p const for rib_delete

The prefix'es p and src_p are not const.  Let's make
them so.  Useful to signal that we will not change this
data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16657 from Jafaral/ospfv3_test_fix
Donald Sharp [Tue, 27 Aug 2024 00:29:38 +0000 (20:29 -0400)]
Merge pull request #16657 from Jafaral/ospfv3_test_fix

tests: Fix frequent ospfv3 basic functionality test failure

8 months agotests: Fix frequent ospfv3 basic functionality test failure 16657/head
Jafar Al-Gharaibeh [Mon, 26 Aug 2024 20:06:35 +0000 (15:06 -0500)]
tests: Fix frequent ospfv3 basic functionality test failure

The dead timer is set to 4 seconds, while the hello interval is set to 6535.
This test will only pass of the platform is fast enough for ospfv3 to
converge in 4 seconds. These timers were already tested multiple time earlier.
This test should just make sure that the boundary value 65535 is configurable,

Other changes in this commit:
  - add sequence numbers to the dead intervals tests to make it easier to
    track test faliures.
  - swap the config order in one test to match order with all other tests.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16649 from opensourcerouting/fix/free_memory_on_return
Donald Sharp [Sat, 24 Aug 2024 19:30:45 +0000 (15:30 -0400)]
Merge pull request #16649 from opensourcerouting/fix/free_memory_on_return

bgpd: Free epvn_overlay memory on error

8 months agobgpd: Free epvn_overlay memory on error 16649/head
Donatas Abraitis [Sat, 24 Aug 2024 08:58:48 +0000 (11:58 +0300)]
bgpd: Free epvn_overlay memory on error

When parsing EVPN NLRIs, and an error occurred, do no forget to free the memory.

Fixes: 4ace11d010 ("bgpd: Move evpn_overlay to a pointer")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16646 from csilt/pim-ifp-crash
Donatas Abraitis [Sat, 24 Aug 2024 08:12:23 +0000 (11:12 +0300)]
Merge pull request #16646 from csilt/pim-ifp-crash

pimd: Fix crash in pimd

8 months agoMerge pull request #16631 from pguibert6WIND/imported_from_l3nhg_json
Donatas Abraitis [Sat, 24 Aug 2024 06:32:49 +0000 (09:32 +0300)]
Merge pull request #16631 from pguibert6WIND/imported_from_l3nhg_json

bgpd: add json support for BGP L3NHG values

8 months agopimd: Fix crash in pimd 16646/head
Corey Siltala [Fri, 23 Aug 2024 18:04:26 +0000 (18:04 +0000)]
pimd: Fix crash in pimd

ifp->info is not always set in PIM. So add a guard here to stop
it from crashing when addresses are added to a non-PIM enabled interface
and PIM zebra debugging is enabled.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
8 months agoMerge pull request #16609 from donaldsharp/singleton_no_weight
Mark Stapp [Fri, 23 Aug 2024 20:19:29 +0000 (16:19 -0400)]
Merge pull request #16609 from donaldsharp/singleton_no_weight

Reduce the number of Singleton objects when using weight for NHG's

8 months agoMerge pull request #16640 from louis-6wind/fix-nhrp-local
Donatas Abraitis [Fri, 23 Aug 2024 19:57:09 +0000 (22:57 +0300)]
Merge pull request #16640 from louis-6wind/fix-nhrp-local

nhrpd: fix sending /32 shortcut

8 months agoMerge pull request #16633 from Jafaral/fix-version-build
Donald Sharp [Fri, 23 Aug 2024 18:45:33 +0000 (14:45 -0400)]
Merge pull request #16633 from Jafaral/fix-version-build

config: fix missing case when reporting version 'configured with'

8 months agonhrpd: fix sending /32 shortcut 16640/head
Louis Scalbert [Fri, 23 Aug 2024 14:05:45 +0000 (16:05 +0200)]
nhrpd: fix sending /32 shortcut

The remote spoke always sends a 32 prefix length to a shortcut request.
In the example, the remote spoke as the IP address 192.168.2.1/24.

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.1/32           10.255.255.2

Do not deal with local routes in nhrpd. Now:

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.0/24           10.255.255.2

Fixes: d4aa24ba7d ("*: Introduce Local Host Routes to FRR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agobgpd: add json support for BGP L3NHG values 16631/head
Philippe Guibert [Thu, 22 Aug 2024 14:53:55 +0000 (16:53 +0200)]
bgpd: add json support for BGP L3NHG values

Some json attributes are missing for L3NHG values.

> PE1# show bgp vrf all detail
> [..]
> Instance vrf-purple:
> BGP table version is 1, local router ID is 27.3.0.85, vrf id 7
> Default local pref 100, local AS 65000
> BGP routing table entry for fe80::4620:ff:feff:ff01/128, version 1
> Paths: (1 available, best #1, vrf vrf-purple)
>   Not advertised to any peer
>   Imported from 10.30.30.30:5:[2]:[0]:[48]:[44:20:00:ff:ff:01]:[128]:[fe80::4620:ff:feff:ff01], VNI 4000  Local
>     ::ffff:a1e:1e1e (metric 20) from 10.30.30.30 (10.30.30.30) announce-nh-self
>       Origin IGP, localpref 100, valid, internal, best (First path received)
>       Extended Community: RT:65000:4000 ET:8
>       Last update: Thu Aug 22 18:23:38 2024
>
> Displayed 1 routes and 1 total paths

> PE1# show bgp vrf all json detail
> {
> "vrf-purple":{
>  "vrfId": 7,
>  "vrfName": "vrf-purple",
>  "tableVersion": 1,
>  "routerId": "27.3.0.85",
>  "defaultLocPrf": 100,
>  "localAS": 65000,
>  "routes": { "fe80::4620:ff:feff:ff01/128": [{"importedFrom":"10.30.30.30:5","l3nhg":false,"l3nhgActive":false, "vni": "4000",
> "aspath":{"string":"Local","segments":[],"length":0},"announceNexthopSelf":true,"origin":"IGP","locPrf":100,
> "valid":true,"version":1,"bestpath":{"overall":true,"selectionReason":"First path received"},
> "extendedCommunity":{"string":"RT:65000:4000 ET:8"},"lastUpdate":{"epoch":1724343817,
> "string":"Thu Aug 22 18:23:37 2024\n"},
> "nexthops":[{"ip":"::ffff:a1e:1e1e","hostname":"PE2","afi":"ipv6",
> "scope":"global","metric":20,"accessible":true,"used":true}],
> "peer":{"peerId":"10.30.30.30","routerId":"10.30.30.30","hostname":"PE2","type":"internal"}}]
>  }  }
> }

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 months agoMerge pull request #15561 from kraj/master
Jafar Al-Gharaibeh [Fri, 23 Aug 2024 04:34:00 +0000 (00:34 -0400)]
Merge pull request #15561 from kraj/master

Mimic GNU basename() API for non-glibc library e.g. musl

8 months agoMerge pull request #16632 from donaldsharp/SA_warnings_from_upstream
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 22:25:11 +0000 (18:25 -0400)]
Merge pull request #16632 from donaldsharp/SA_warnings_from_upstream

Sa warnings from upstream

8 months agoMerge pull request #16615 from Jafaral/revert-v4-v6-bgp
Donald Sharp [Thu, 22 Aug 2024 21:57:38 +0000 (17:57 -0400)]
Merge pull request #16615 from Jafaral/revert-v4-v6-bgp

Revert ipv4-mapped ipv6 and 6vpe nexthop in BGP

8 months agozebra: Mimic GNU basename() API for non-glibc library e.g. musl 15561/head
Khem Raj [Fri, 15 Mar 2024 21:34:06 +0000 (14:34 -0700)]
zebra: Mimic GNU basename() API for non-glibc library e.g. musl

musl only provides POSIX version of basename and it has also removed
providing it via string.h header [1] which now results in compile errors
with newer compilers e.g. clang-18

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
8 months agoconfig: fix missing case when reporting version 'configured with' 16633/head
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 19:26:01 +0000 (14:26 -0500)]
config: fix missing case when reporting version 'configured with'

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16630 from donaldsharp/babel_metric
Mark Stapp [Thu, 22 Aug 2024 19:20:32 +0000 (15:20 -0400)]
Merge pull request #16630 from donaldsharp/babel_metric

Babel metric

8 months agolib: Ensure SA that root cannot be NULL 16632/head
Donald Sharp [Thu, 22 Aug 2024 17:53:47 +0000 (13:53 -0400)]
lib: Ensure SA that root cannot be NULL

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: global_gr_mode does not need to be set twice
Donald Sharp [Thu, 22 Aug 2024 17:32:20 +0000 (13:32 -0400)]
bgpd: global_gr_mode does not need to be set twice

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Create Singleton nhg's without weights 16609/head
Donald Sharp [Tue, 20 Aug 2024 14:53:34 +0000 (10:53 -0400)]
zebra: Create Singleton nhg's without weights

Currently FRR when it has two nexthop groups:
A
  nexthop 1 weight 5
  nexthop 2 weight 6
  nexthop 3 weight 7
B
  nexthop 1 weight 3
  nexthop 2 weight 4
  nexthop 3 weight 5

We end up with 5 singleton nexthops and two groups:

ID: 181818168 (sharp)
     RefCnt: 1
     Uptime: 00:04:52
     VRF: default
     Valid, Installed
     Depends: (69) (70) (71)
           via 192.168.119.1, enp13s0 (vrf default), weight 182
           via 192.168.119.2, enp13s0 (vrf default), weight 218
           via 192.168.119.3, enp13s0 (vrf default), weight 255
ID: 181818169 (sharp)
     RefCnt: 1
     Uptime: 00:02:08
     VRF: default
     Valid, Installed
     Depends: (71) (127) (128)
           via 192.168.119.1, enp13s0 (vrf default), weight 127
           via 192.168.119.2, enp13s0 (vrf default), weight 170
           via 192.168.119.3, enp13s0 (vrf default), weight 255

id 69 via 192.168.119.1 dev enp13s0 scope link proto 194
id 70 via 192.168.119.2 dev enp13s0 scope link proto 194
id 71 via 192.168.119.3 dev enp13s0 scope link proto 194
id 127 via 192.168.119.1 dev enp13s0 scope link proto 194
id 128 via 192.168.119.2 dev enp13s0 scope link proto 194
id 181818168 group 69,182/70,218/71,255 proto 194
id 181818169 group 71,255/127,127/128,170 proto 194

This is not a desirable state to be in.  If you have a
link flapping in the network and weights are changing
rapidly you end up with a large number of singleton
nexthops that are being used by the nexthop groups.
This fills up asic space and clutters the table.
Additionally singleton nexthops cannot have any weight
and the fact that you attempt to create a singleton
nexthop with different weights means nothing to the
linux kernel( or any asic dplane ).  Let's modify
the code to always create the singleton nexthops
without a weight and then just creating the
NHG's that use the singletons with the appropriate
weight.

ID: 181818168 (sharp)
     RefCnt: 1
     Uptime: 00:00:32
     VRF: default
     Valid, Installed
     Depends: (22) (24) (28)
           via 192.168.119.1, enp13s0 (vrf default), weight 182
           via 192.168.119.2, enp13s0 (vrf default), weight 218
           via 192.168.119.3, enp13s0 (vrf default), weight 255
ID: 181818169 (sharp)
     RefCnt: 1
     Uptime: 00:00:14
     VRF: default
     Valid, Installed
     Depends: (22) (24) (28)
           via 192.168.119.1, enp13s0 (vrf default), weight 153
           via 192.168.119.2, enp13s0 (vrf default), weight 204
           via 192.168.119.3, enp13s0 (vrf default), weight 255

id 22 via 192.168.119.1 dev enp13s0 scope link proto 194
id 24 via 192.168.119.2 dev enp13s0 scope link proto 194
id 28 via 192.168.119.3 dev enp13s0 scope link proto 194
id 181818168 group 22,182/24,218/28,255 proto 194
id 181818169 group 22,153/24,204/28,255 proto 194

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agolib, zebra: Modify nexthop_cmp to allow you to use weight or not
Donald Sharp [Tue, 20 Aug 2024 12:28:17 +0000 (08:28 -0400)]
lib, zebra: Modify nexthop_cmp to allow you to use weight or not

Currently nexthop weight is a discriminator on whether or not
a nexthop matches.  There is a need to no use the weight as
part of this comparison function so let's add a boolean to
allow us to say use this or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoRevert "Merge pull request #15368 from louis-6wind/fix-6pe" 16615/head
Jafar Al-Gharaibeh [Wed, 21 Aug 2024 18:40:18 +0000 (13:40 -0500)]
Revert "Merge pull request #15368 from louis-6wind/fix-6pe"

This reverts commit df98e8836897135b34080909bb6c4d91218a8e59, reversing
changes made to b6521192354df3f614b244323876e43dd0b58e56.

8 months agoMerge pull request #16450 from nabahr/static_joins
Donald Sharp [Thu, 22 Aug 2024 15:32:56 +0000 (11:32 -0400)]
Merge pull request #16450 from nabahr/static_joins

PIM: Implement static IGMP joins without an IGMP report

8 months agoMerge pull request #16613 from donaldsharp/weight_issues
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 15:19:54 +0000 (11:19 -0400)]
Merge pull request #16613 from donaldsharp/weight_issues

Weight issues

8 months agoMerge pull request #16620 from LabNConsulting/new-munet-0-14-10
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 15:14:18 +0000 (11:14 -0400)]
Merge pull request #16620 from LabNConsulting/new-munet-0-14-10

tests: update munet to 0.14.10

8 months agobabeld: Do not remove route when replacing 16630/head
Donald Sharp [Thu, 22 Aug 2024 14:24:42 +0000 (10:24 -0400)]
babeld: Do not remove route when replacing

When sending down a babel route do not remove then
add it back.  Just send down the change.  This
change will not cause packets to be dropped now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobabeld: Send the route's metric down to zebra.
Donald Sharp [Thu, 22 Aug 2024 14:22:58 +0000 (10:22 -0400)]
babeld: Send the route's metric down to zebra.

Babel was thinking it was talking to the kernel for
route installation instead of zebra.  Pass down the
metric instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16621 from LabNConsulting/fix-grpc-client
Donatas Abraitis [Thu, 22 Aug 2024 07:41:34 +0000 (09:41 +0200)]
Merge pull request #16621 from LabNConsulting/fix-grpc-client

tests: dont print sys.path when running grpc-query.py

8 months agoMerge pull request #16546 from dmytroshytyi-6WIND/fix_bgp_open_notification_snmp
Donatas Abraitis [Thu, 22 Aug 2024 05:18:23 +0000 (07:18 +0200)]
Merge pull request #16546 from dmytroshytyi-6WIND/fix_bgp_open_notification_snmp

bgpd: fix, do not access peer->notify.data when it is null

8 months agoMerge pull request #16619 from qlyoung/fix-rtd-build-sphinx-environment-injection
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 04:05:24 +0000 (00:05 -0400)]
Merge pull request #16619 from qlyoung/fix-rtd-build-sphinx-environment-injection

doc: update sphinx configs for RTD changes

8 months agotests: dont print sys.path when running grpc-query.py 16621/head
Christian Hopps [Thu, 22 Aug 2024 02:03:48 +0000 (22:03 -0400)]
tests: dont print sys.path when running grpc-query.py

Don't print the sys.path when running grpc-query.py. Doing so
was causing tests to fail.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 months agotests: update munet to 0.14.10 16620/head
Christian Hopps [Thu, 22 Aug 2024 01:05:48 +0000 (21:05 -0400)]
tests: update munet to 0.14.10

Changes:

- mutini: handle possible missed zombie cleanup leading to test hangs
- mutini: also we avoid logging in the signal handler which was causing
  an exception.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 months agodoc: update sphinx configs for RTD changes 16619/head
Quentin Young [Wed, 21 Aug 2024 23:38:09 +0000 (19:38 -0400)]
doc: update sphinx configs for RTD changes

Read The Docs made some changes that require us to add some
configuration in our build config files.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
8 months agoMerge pull request #16608 from louis-6wind/fix-no-rpki
Donatas Abraitis [Wed, 21 Aug 2024 20:12:05 +0000 (22:12 +0200)]
Merge pull request #16608 from louis-6wind/fix-no-rpki

bgpd: fix crash at no rpki

8 months agoRevert "Merge pull request #15614 from louis-6wind/fix-6pe-address"
Jafar Al-Gharaibeh [Wed, 21 Aug 2024 18:37:43 +0000 (13:37 -0500)]
Revert "Merge pull request #15614 from louis-6wind/fix-6pe-address"

This reverts commit b3600d82dca4f23db4f42c46b25d3db48e1a4312, reversing
changes made to 51119823d02847f6095725e520264c85af94b37f.

8 months agoRevert "Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6"
Jafar Al-Gharaibeh [Wed, 21 Aug 2024 18:26:50 +0000 (13:26 -0500)]
Revert "Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6"

This reverts commit cc0fdd3b1d1b3554896fc03eec16379b7bae2b40, reversing
changes made to 4e208087fd854e3e1528519745447f69691b04ad.

8 months agozebra, tests: Connected and Local routes should have a weight of 1 16613/head
Donald Sharp [Thu, 22 Feb 2024 20:53:45 +0000 (15:53 -0500)]
zebra, tests: Connected and Local routes should have a weight of 1

All routes received by zebra from upper level protocols have a weight
of 1.  Let's just make everything extremely consistent in our code.
Lot's of tests needed to be fixed up to make this work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Ensure we cannot send invalid range to kernel
Donald Sharp [Thu, 22 Feb 2024 21:20:37 +0000 (16:20 -0500)]
zebra: Ensure we cannot send invalid range to kernel

The linux kernel adds 1 upon receipt of a weight, if you
send a 255 it gets unhappy.  Let's Limit range to 254 as
that kernel does not like sending of 255.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotopotest: test_bgp_snmp_bgpv4v2_notification 16546/head
Dmytro Shytyi [Thu, 8 Aug 2024 13:42:40 +0000 (15:42 +0200)]
topotest: test_bgp_snmp_bgpv4v2_notification

This test checks the bgp crash on rt2 when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password 8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: test if rt2 bgp is crashed.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
8 months agobgpd: fix, do not access peer->notify.data when it is null
Dmytro Shytyi [Thu, 8 Aug 2024 13:53:11 +0000 (15:53 +0200)]
bgpd: fix, do not access peer->notify.data when it is null

bgp crash on rt2 spotted when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password
8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: rt2 bgp is crashed.

config rt2-bgp:
---------------

!
debug bgp updates
!
router bgp 65002
 no bgp ebgp-requires-policy
 no bgp network import-check
 no bgp default ipv4-unicast
 neighbor 192.168.12.4 remote-as external
 neighbor 192.168.12.4 timers 1 3
 neighbor 192.168.12.4 timers connect 1
 neighbor 2001:db8::12:4 remote-as external
 neighbor 2001:db8::12:4 timers 1 3
 neighbor 2001:db8::12:4 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 192.168.12.4 activate
  neighbor 192.168.12.4 addpath-tx-all-paths

 exit-address-family
 address-family ipv6 unicast
  neighbor 2001:db8::12:4 activate
 exit-address-family
!
agentx
!

config rt2-snmpd:
agentAddress 127.0.0.1,[::1]

group public_group v1 public
group public_group v2c public
access public_group "" any noauth prefix all all none

rocommunity public default

view all included .1

iquerySecName frr
rouser frr

master agentx

agentXSocket /etc/frr/agentx
agentXPerms 777 755 root frr

config rt2-zebra:
-----------------

!
interface r2-eth0
 ip address 192.168.12.2/24
 ipv6 address 2001:db8::12:2/64
!

config rr-bgpd:
---------------

!
debug bgp updates
!
router bgp 65004
 no bgp ebgp-requires-policy
 no bgp network import-check
 no bgp default ipv4-unicast
 neighbor 192.168.12.1 remote-as external
 neighbor 192.168.12.1 timers 1 3
 neighbor 192.168.12.1 timers connect 1
 neighbor 192.168.12.2 remote-as external
 neighbor 192.168.12.2 timers 1 3
 neighbor 192.168.12.2 timers connect 1
 neighbor 192.168.12.3 remote-as external
 neighbor 192.168.12.3 timers 1 3
 neighbor 192.168.12.3 timers connect 1
 neighbor 2001:db8::12:1 remote-as external
 neighbor 2001:db8::12:1 timers 1 3
 neighbor 2001:db8::12:1 timers connect 1
 neighbor 2001:db8::12:2 remote-as external
 neighbor 2001:db8::12:2 timers 1 3
 neighbor 2001:db8::12:2 timers connect 1
 neighbor 2001:db8::12:3 remote-as external
 neighbor 2001:db8::12:3 timers 1 3
 neighbor 2001:db8::12:3 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 192.168.12.1 activate
  neighbor 192.168.12.1 addpath-tx-all-paths
  neighbor 192.168.12.1 route-server-client
  neighbor 192.168.12.2 activate
  neighbor 192.168.12.2 addpath-tx-all-paths
  neighbor 192.168.12.2 route-server-client
  neighbor 192.168.12.3 activate
  neighbor 192.168.12.3 addpath-tx-all-paths
  neighbor 192.168.12.3 route-server-client
 exit-address-family
 address-family ipv6 unicast
  neighbor 2001:db8::12:1 activate
  neighbor 2001:db8::12:1 route-server-client
  neighbor 2001:db8::12:2 activate
  neighbor 2001:db8::12:2 route-server-client
  neighbor 2001:db8::12:3 activate
  neighbor 2001:db8::12:3 route-server-client
 exit-address-family
!
agentx
!

config rr-zebra:
----------------
!
interface rr-eth0
 ip address 192.168.12.4/24
 ipv6 address 2001:db8::12:4/64
!

Fixes: 2d8fff6b81bb ("bgpd: Implement BGP4V2-MIB(bgp4V2PeerErrorsTable)")
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
8 months agobgpd: fix crash at no rpki 16608/head
Louis Scalbert [Tue, 20 Aug 2024 08:33:30 +0000 (10:33 +0200)]
bgpd: fix crash at no rpki

When 'no rpki' is requested and the rtrlib RPKI object was freed, bgpd
is crashing.

RPKI is configured in VRF red.

> ip l set red down
> ip l del red
> printf 'conf\n vrf red\n no rpki' | vtysh

> Core was generated by `/usr/bin/bgpd -A 127.0.0.1 -M snmp -M rpki -M bmp'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:44
> 44 ./nptl/pthread_kill.c: No such file or directory.
> [Current thread is 1 (Thread 0x7fb401f419c0 (LWP 190226))]
> (gdb) bt
> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:44
> #1  __pthread_kill_internal (signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:78
> #2  __GI___pthread_kill (threadid=140411103615424, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
> #3  0x00007fb4021ad476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
> #4  0x00007fb4025ce22b in core_handler (signo=11, siginfo=0x7fff831b2d70, context=0x7fff831b2c40) at lib/sigevent.c:248
> #5  <signal handler called>
> #6  rtr_mgr_remove_group (config=0x55fe8789f750, preference=11) at /build/make-pkg/output/source/DIST_RTRLIB/rtrlib/rtrlib/rtr_mgr.c:607
> #7  0x00007fb40145f518 in rpki_delete_all_cache_nodes (rpki_vrf=0x55fe8789f4f0) at bgpd/bgp_rpki.c:442
> #8  0x00007fb401463098 in no_rpki_magic (self=0x7fb40146bba0 <no_rpki_cmd>, vty=0x55fe877f5130, argc=2, argv=0x55fe877fccd0) at bgpd/bgp_rpki.c:1732
> #9  0x00007fb40145c09a in no_rpki (self=0x7fb40146bba0 <no_rpki_cmd>, vty=0x55fe877f5130, argc=2, argv=0x55fe877fccd0) at ./bgpd/bgp_rpki_clippy.c:37
> #10 0x00007fb402527abc in cmd_execute_command_real (vline=0x55fe877fd150, vty=0x55fe877f5130, cmd=0x0, up_level=0) at lib/command.c:984
> #11 0x00007fb402527c35 in cmd_execute_command (vline=0x55fe877fd150, vty=0x55fe877f5130, cmd=0x0, vtysh=0) at lib/command.c:1043
> #12 0x00007fb4025281e5 in cmd_execute (vty=0x55fe877f5130, cmd=0x55fe877fb8c0 "no rpki\n", matched=0x0, vtysh=0) at lib/command.c:1209
> #13 0x00007fb4025f0aed in vty_command (vty=0x55fe877f5130, buf=0x55fe877fb8c0 "no rpki\n") at lib/vty.c:615
> #14 0x00007fb4025f2a11 in vty_execute (vty=0x55fe877f5130) at lib/vty.c:1378
> #15 0x00007fb4025f513d in vtysh_read (thread=0x7fff831b5fa0) at lib/vty.c:2373
> #16 0x00007fb4025e9611 in event_call (thread=0x7fff831b5fa0) at lib/event.c:2011
> #17 0x00007fb402566976 in frr_run (master=0x55fe871a14a0) at lib/libfrr.c:1212
> #18 0x000055fe857829fa in main (argc=9, argv=0x7fff831b6218) at bgpd/bgp_main.c:549

Fixes: 8156765abe ("bgpd: Add `no rpki` command")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agoMerge pull request #16597 from kprovost/master
Jafar Al-Gharaibeh [Mon, 19 Aug 2024 17:02:36 +0000 (13:02 -0400)]
Merge pull request #16597 from kprovost/master

zebra: fix loading kernel routes without netlink

8 months agoMerge pull request #16605 from donaldsharp/spelling_in_master_2
Mark Stapp [Mon, 19 Aug 2024 13:20:36 +0000 (09:20 -0400)]
Merge pull request #16605 from donaldsharp/spelling_in_master_2

Spelling in master 2

8 months agobgpd: Actually ensure the hash works 16605/head
Donald Sharp [Sun, 18 Aug 2024 20:26:45 +0000 (16:26 -0400)]
bgpd: Actually ensure the hash works

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Do not assign time and then never use it
Donald Sharp [Sun, 18 Aug 2024 20:18:54 +0000 (16:18 -0400)]
zebra: Do not assign time and then never use it

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months ago*: Spelling issues
Donald Sharp [Sun, 18 Aug 2024 17:29:26 +0000 (13:29 -0400)]
*: Spelling issues

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16602 from LabNConsulting/chopps/fix-warnings
Donald Sharp [Sun, 18 Aug 2024 19:22:33 +0000 (15:22 -0400)]
Merge pull request #16602 from LabNConsulting/chopps/fix-warnings

mgmtd: fix a couple compilation warnings.

8 months agoMerge pull request #16603 from cscarpitta/fix/fix-compilation-warnings
Donald Sharp [Sun, 18 Aug 2024 17:34:12 +0000 (13:34 -0400)]
Merge pull request #16603 from cscarpitta/fix/fix-compilation-warnings

lib, zebra: Fix a couple compilation warnings

8 months agoMerge pull request #16601 from LabNConsulting/aceelindem/ospf-sa-warning-fix
Donald Sharp [Sun, 18 Aug 2024 16:49:12 +0000 (12:49 -0400)]
Merge pull request #16601 from LabNConsulting/aceelindem/ospf-sa-warning-fix

 ospfd: Fix SA warnings in ospf_packet.c and ospf_vty.c

8 months agoMerge pull request #16599 from anlancs/fix/pimd-limit-join
Donald Sharp [Sun, 18 Aug 2024 16:48:51 +0000 (12:48 -0400)]
Merge pull request #16599 from anlancs/fix/pimd-limit-join

pimd: fix missing checking the return value for igmp command

8 months agozebra: Fix compilation warning 16603/head
Carmine Scarpitta [Sun, 18 Aug 2024 11:02:06 +0000 (13:02 +0200)]
zebra: Fix compilation warning

Make sure the variable `srv6` is not NULL before dereferencing it.

Fixes the following compilation warnings:

```
error 15-Aug-2024 14:20:01 zebra/zebra_srv6_vty.c:974:8: warning: Access to field 'locators' results in a dereference of a null pointer (loaded from variable 'srv6') [core.NullDereference]
error 15-Aug-2024 14:20:01                 for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) {
error 15-Aug-2024 14:20:01                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error 15-Aug-2024 14:20:01 ./lib/linklist.h:345:11: note: expanded from macro 'ALL_LIST_ELEMENTS_RO'
error 15-Aug-2024 14:20:01         (node) = listhead(list), ((data) = NULL);                              \
error 15-Aug-2024 14:20:01                  ^~~~~~~~~~~~~~
error 15-Aug-2024 14:20:01 ./lib/linklist.h:63:22: note: expanded from macro 'listhead'
error 15-Aug-2024 14:20:01 #define listhead(X) ((X) ? ((X)->head) : NULL)
error 15-Aug-2024 14:20:01                      ^
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
8 months agolib: Fix compilation warning
Carmine Scarpitta [Sun, 18 Aug 2024 10:57:34 +0000 (12:57 +0200)]
lib: Fix compilation warning

Don't store unnecessary `len` returned by snprintf and snprintfrr function.

Fixes the following compilation warnings:

```
error 15-Aug-2024 13:54:10 In file included from lib/bfd.c:16:
error 15-Aug-2024 13:54:10 In file included from ./lib/zclient.h:22:
error 15-Aug-2024 13:54:10 In file included from ./lib/nexthop.h:14:
error 15-Aug-2024 13:54:10 ./lib/srv6.h:338:3: warning: Value stored to 'len' is never read [deadcode.DeadStores]
error 15-Aug-2024 13:54:10                 len += snprintf(str + len, size - len, " USP");
error 15-Aug-2024 13:54:10                 ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error 15-Aug-2024 13:54:10 ./lib/srv6.h:343:3: warning: Value stored to 'len' is never read [deadcode.DeadStores]
error 15-Aug-2024 13:54:10                 len += snprintfrr(str + len, size - len, " nh6 %pI6", &ctx->nh6);
error 15-Aug-2024 13:54:10                 ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error 15-Aug-2024 13:54:10 ./lib/srv6.h:347:3: warning: Value stored to 'len' is never read [deadcode.DeadStores]
error 15-Aug-2024 13:54:10                 len += snprintfrr(str + len, size - len, " nh4 %pI4", &ctx->nh4);
error 15-Aug-2024 13:54:10                 ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error 15-Aug-2024 13:54:10 ./lib/srv6.h:354:3: warning: Value stored to 'len' is never read [deadcode.DeadStores]
error 15-Aug-2024 13:54:10                 len += snprintf(str + len, size - len, " vrf_id %u",
error 15-Aug-2024 13:54:10                 ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error 15-Aug-2024 13:54:10 ./lib/srv6.h:367:3: warning: Value stored to 'len' is never read [deadcode.DeadStores]
error 15-Aug-2024 13:54:10                 len += snprintf(str + len, size - len, " unknown(%s)", __func__);
error 15-Aug-2024 13:54:10                 ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
8 months agomgmtd: fix a couple compilation warnings. 16602/head
Christian Hopps [Sun, 18 Aug 2024 10:33:29 +0000 (05:33 -0500)]
mgmtd: fix a couple compilation warnings.

Also an empty (thus non-replace) notify selectors message shouldn't
clear the selectors, it should just do nothing.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 months ago ospfd: Fix SA warnings in ospf_packet.c and ospf_vty.c 16601/head
Acee [Fri, 16 Aug 2024 17:49:41 +0000 (13:49 -0400)]
 ospfd: Fix SA warnings in ospf_packet.c and ospf_vty.c

    Fix SA warnings in ospf_packet.c and ospf_vty.c. The former was
    introduced by commit ed480148844259b7e9e30ed92489cdf44085457e.

Signed-off-by: Acee <aceelindem@gmail.com>
8 months agopimd: fix missing checking the return value for igmp command 16599/head
anlan_cs [Thu, 15 Aug 2024 12:49:24 +0000 (20:49 +0800)]
pimd: fix missing checking the return value for igmp command

`gm_join_new()` will return NULL in the case of running out of
socket/file resources.  Just add the check for it.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
8 months agozebra: fix loading kernel routs without netlink 16597/head
Kristof Provost [Thu, 15 Aug 2024 16:34:35 +0000 (18:34 +0200)]
zebra: fix loading kernel routs without netlink

Commit 605df8d44 zebra: Use zebra dplane for RTM link and addr broke loading of
kernel routes at startup for configurations without netlink.

It rearranged the startup sequence in zebra_ns_enable() to pass via
zebra_ns_startup_continue(), triggered through zebra_dplane_startup_stage()
calls. However, it neglected to make these calls in the non-netlink code path.
As a result zebra failed to load kernel routes at startup on platforms such
as FreeBSD.

Insert these calls so we run through all of the expected startup stages.

Signed-off-by: Kristof Provost <kprovost@netgate.com>
8 months agoMerge pull request #16590 from donaldsharp/spelling_in_master
Mark Stapp [Thu, 15 Aug 2024 18:42:11 +0000 (14:42 -0400)]
Merge pull request #16590 from donaldsharp/spelling_in_master

*: Fix spelling errors found

8 months agoMerge pull request #16589 from opensourcerouting/fix/remove_deprecated_confdate
Mark Stapp [Thu, 15 Aug 2024 17:45:38 +0000 (13:45 -0400)]
Merge pull request #16589 from opensourcerouting/fix/remove_deprecated_confdate

ospfd: Remove deprecated router_info_area_id_cmd

8 months agotests: Added new topotest for pim igmp static groups 16450/head
Nathan Bahr [Thu, 15 Aug 2024 17:10:32 +0000 (17:10 +0000)]
tests: Added new topotest for pim igmp static groups

Copied the existing "join-group" test and modified to test
static groups instead. Functionally the same but without IGMP
reports.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
8 months agodoc: Add PIM docs for join-group and static-group
Nathan Bahr [Mon, 1 Jul 2024 16:49:15 +0000 (11:49 -0500)]
doc: Add PIM docs for join-group and static-group

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
8 months agopimd, yang: Implement igmp static-group command
Nathan Bahr [Wed, 26 Jun 2024 17:41:45 +0000 (12:41 -0500)]
pimd, yang: Implement igmp static-group command

This will add a static IGMP group that does not rely on an underlying
socket join which sends traffic to the cpu unneccesarily. Instead, the
groups are joined directly without any IGMP interactions.
New command is under interfaces, 'ip igmp static-group ...'.
Added an alias for 'ip igmp join ...' to 'ip igmp join-group'.
Moved IGMP join groups to new yang list "join-group" and reused
the "static-group" list for the IGMP static groups.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
8 months agoMerge pull request #16586 from donaldsharp/fix_route_scale_startup
Mark Stapp [Thu, 15 Aug 2024 13:21:12 +0000 (09:21 -0400)]
Merge pull request #16586 from donaldsharp/fix_route_scale_startup

tests: Fix route_scale startup issues

8 months agoMerge pull request #16549 from opensourcerouting/fix/some_memory_optimizations_for_st...
Donald Sharp [Thu, 15 Aug 2024 13:20:41 +0000 (09:20 -0400)]
Merge pull request #16549 from opensourcerouting/fix/some_memory_optimizations_for_struct_attr

bgpd: Move evpn_overlay to a pointer

8 months ago*: Fix spelling errors found 16590/head
Donald Sharp [Wed, 14 Aug 2024 20:53:09 +0000 (16:53 -0400)]
*: Fix spelling errors found

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16585 from pguibert6WIND/prd_pretty_mt_fix
Donatas Abraitis [Thu, 15 Aug 2024 06:59:47 +0000 (08:59 +0200)]
Merge pull request #16585 from pguibert6WIND/prd_pretty_mt_fix

bgpd: fix memory type for static->prd_pretty

8 months agoospfd: Remove deprecated router_info_area_id_cmd 16589/head
Donatas Abraitis [Wed, 14 Aug 2024 20:16:39 +0000 (23:16 +0300)]
ospfd: Remove deprecated router_info_area_id_cmd

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16578 from donaldsharp/more_memory_leaks_on_shutdown
Donatas Abraitis [Wed, 14 Aug 2024 20:09:39 +0000 (22:09 +0200)]
Merge pull request #16578 from donaldsharp/more_memory_leaks_on_shutdown

More memory leaks on shutdown

8 months agoMerge pull request #16583 from mjstapp/fix_all_proto_nhg
Donald Sharp [Wed, 14 Aug 2024 18:54:27 +0000 (14:54 -0400)]
Merge pull request #16583 from mjstapp/fix_all_proto_nhg

tests: add retries to nhg tests in all_proto_startup

8 months agoMerge pull request #16574 from donaldsharp/non_json_free_ptr
Donatas Abraitis [Wed, 14 Aug 2024 16:44:54 +0000 (18:44 +0200)]
Merge pull request #16574 from donaldsharp/non_json_free_ptr

bgpd: Free up non-freed json memory on function return

8 months agotests: Fix route_scale startup issues 16586/head
Donald Sharp [Wed, 14 Aug 2024 14:18:41 +0000 (10:18 -0400)]
tests: Fix route_scale startup issues

Upstream CI is frequently running into a situation where
the routes are not being installed.  These routes
start at the beginning and suddenly in the middle
they start working properly.

D   1.0.15.183/32 [150/0] via 192.168.0.1, r1-eth0 inactive, weight 1, 00:10:17
                          via 192.168.1.1, r1-eth1 inactive, weight 1, 00:10:17
D   1.0.15.184/32 [150/0] via 192.168.0.1, r1-eth0 inactive, weight 1, 00:10:17
                          via 192.168.1.1, r1-eth1 inactive, weight 1, 00:10:17
D   1.0.15.185/32 [150/0] via 192.168.0.1, r1-eth0 inactive, weight 1, 00:10:17
                          via 192.168.1.1, r1-eth1 inactive, weight 1, 00:10:17
D>* 1.0.15.186/32 [150/0] via 192.168.0.1, r1-eth0, weight 1, 00:10:17
  *                       via 192.168.1.1, r1-eth1, weight 1, 00:10:17
D>* 1.0.15.187/32 [150/0] via 192.168.0.1, r1-eth0, weight 1, 00:10:17
  *                       via 192.168.1.1, r1-eth1, weight 1, 00:10:17
D>* 1.0.15.188/32 [150/0] via 192.168.0.1, r1-eth0, weight 1, 00:10:17

Turning on some debugs showed that the failed installed routes are
trying to be matched against the default route.  Thus implying
all the connected routes for the test are not yet successfully
installed.  Let's modify the test(s) on startup to just ensure
that the connected routes are installed correctly.  I am no
longer seeing the problem after this change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: fix memory type for static->prd_pretty 16585/head
Philippe Guibert [Wed, 14 Aug 2024 13:36:36 +0000 (15:36 +0200)]
bgpd: fix memory type for static->prd_pretty

A crash happens when executing the following command:

> ubuntu2204hwe# conf
> ubuntu2204hwe(config)# router bgp 65500
> ubuntu2204hwe(config-router)#  !
> ubuntu2204hwe(config-router)#  address-family ipv4 unicast
> ubuntu2204hwe(config-router-af)#   sid vpn export auto
> ubuntu2204hwe(config-router-af)#  exit-address-family
> ubuntu2204hwe(config-router)#  !
> ubuntu2204hwe(config-router)#  address-family ipv4 vpn
> ubuntu2204hwe(config-router-af)#   network 4.4.4.4/32 rd 55:55 label 556
> ubuntu2204hwe(config-router-af)#   network 5.5.5.5/32 rd 662:33 label 232
> ubuntu2204hwe(config-router-af)#  exit-address-family
> ubuntu2204hwe(config-router)# exit
> ubuntu2204hwe(config)# !
> ubuntu2204hwe(config)# no router bgp

The crash analysis indicates a memory item has been freed.

> #6  0x000076066a629c15 in mt_count_free (mt=0x56b57be85e00 <MTYPE_BGP_NAME>, ptr=0x60200038b4f0)
>     at lib/memory.c:73
> #7  mt_count_free (ptr=0x60200038b4f0, mt=0x56b57be85e00 <MTYPE_BGP_NAME>) at lib/memory.c:69
> #8  qfree (mt=mt@entry=0x56b57be85e00 <MTYPE_BGP_NAME>, ptr=0x60200038b4f0) at lib/memory.c:129
> #9  0x000056b57bb09ce9 in bgp_free (bgp=<optimized out>) at bgpd/bgpd.c:4120
> #10 0x000056b57bb0aa73 in bgp_unlock (bgp=<optimized out>) at ./bgpd/bgpd.h:2513
> #11 peer_free (peer=0x62a000000200) at bgpd/bgpd.c:1313
> #12 0x000056b57bb0aca8 in peer_unlock_with_caller (name=<optimized out>, peer=<optimized out>)
>     at bgpd/bgpd.c:1344
> #13 0x000076066a6dbb2c in event_call (thread=thread@entry=0x7ffc8cae1d60) at lib/event.c:2011
> #14 0x000076066a60aa88 in frr_run (master=0x613000000040) at lib/libfrr.c:1214
> #15 0x000056b57b8b2c44 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:543

Actually, the BGP_NAME item has not been used at allocation for
static->prd_pretty, and this results in reaching 0 quicker at bgp
deletion.

Fix this by reassigning MTYPE_BGP_NAME to prd_pretty.

Fixes: 16600df2c4f4 ("bgpd: fix show run of network route-distinguisher")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 months agoMerge pull request #16579 from opensourcerouting/fix/bgpd_use_after_free_no_router_bgp
Donald Sharp [Wed, 14 Aug 2024 12:39:25 +0000 (08:39 -0400)]
Merge pull request #16579 from opensourcerouting/fix/bgpd_use_after_free_no_router_bgp

bgpd: Avoid use-after-free when doing `no router bgp` with auto created instances

8 months agotests: add retries to nhg tests in all_proto_startup 16583/head
Mark Stapp [Wed, 14 Aug 2024 12:37:00 +0000 (08:37 -0400)]
tests: add retries to nhg tests in all_proto_startup

The all_protocol_startup topotest needs to allow for some delay
between configuring nexthop-groups and their installation. Add
some wait periods in a couple of nhg test cases.

Signed-off-by: Mark Stapp <mjs@cisco.com>
8 months agobgpd: Avoid use-after-free when doing `no router bgp` with auto created instances 16579/head
Donatas Abraitis [Wed, 14 Aug 2024 07:16:01 +0000 (10:16 +0300)]
bgpd: Avoid use-after-free when doing `no router bgp` with auto created instances

```
==1145965==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030007159c0 at pc 0x55ade8d962d1 bp 0x7ffec4ce74c0 sp 0x7ffec4ce74b0
READ of size 8 at 0x6030007159c0 thread T0
    0 0x55ade8d962d0 in no_router_bgp bgpd/bgp_vty.c:1701
    1 0x7efe5aed19ed in cmd_execute_command_real lib/command.c:1002
    2 0x7efe5aed1da3 in cmd_execute_command lib/command.c:1061
    3 0x7efe5aed2303 in cmd_execute lib/command.c:1227
    4 0x7efe5af6c023 in vty_command lib/vty.c:616
    5 0x7efe5af6d2d2 in vty_execute lib/vty.c:1379
    6 0x7efe5af77df2 in vtysh_read lib/vty.c:2374
    7 0x7efe5af64c9b in event_call lib/event.c:1996
    8 0x7efe5af03887 in frr_run lib/libfrr.c:1232
    9 0x55ade8cd9850 in main bgpd/bgp_main.c:555
    10 0x7efe5aa29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    11 0x7efe5aa29e3f in __libc_start_main_impl ../csu/libc-start.c:392
    12 0x55ade8cdc314 in _start (/usr/lib/frr/bgpd+0x16f314)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16575 from donaldsharp/doc_address_sanitizer_stuff
Mark Stapp [Tue, 13 Aug 2024 18:18:40 +0000 (14:18 -0400)]
Merge pull request #16575 from donaldsharp/doc_address_sanitizer_stuff

doc: Add doc to show sysctl setting for Sanitizers

8 months agoMerge pull request #16576 from opensourcerouting/fix/free_opaque_data_of_route_entry
Donald Sharp [Tue, 13 Aug 2024 18:14:36 +0000 (14:14 -0400)]
Merge pull request #16576 from opensourcerouting/fix/free_opaque_data_of_route_entry

zebra: Do not forget to free opaque data for route entry

8 months agobabeld: Free up memory on shutdown 16578/head
Donald Sharp [Tue, 13 Aug 2024 18:12:05 +0000 (14:12 -0400)]
babeld: Free up memory on shutdown

a) call vector_delete on created vector on shutdown.
b) Call babel_clean_routing_process on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agopbrd: Call vrf_terminate on shutdown
Donald Sharp [Tue, 13 Aug 2024 18:11:07 +0000 (14:11 -0400)]
pbrd: Call vrf_terminate on shutdown

Free up vrf memory on shutdown.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Do not forget to free opaque data for route entry 16576/head
Donatas Abraitis [Tue, 13 Aug 2024 15:00:30 +0000 (18:00 +0300)]
zebra: Do not forget to free opaque data for route entry

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16559 from donaldsharp/fix_python_warning
Donatas Abraitis [Tue, 13 Aug 2024 14:20:27 +0000 (16:20 +0200)]
Merge pull request #16559 from donaldsharp/fix_python_warning

tests: Fix bgp_duplicate_nexthop python warning

8 months agodoc: Add doc to show sysctl setting for Sanitizers 16575/head
Donald Sharp [Tue, 13 Aug 2024 12:58:29 +0000 (08:58 -0400)]
doc: Add doc to show sysctl setting for Sanitizers

In order to run the XXXX Sanitizers over the code as a developer
modern linux distro's require a specific sysctl.  Let's document
that so that people are aware of it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: Free up non-freed json memory on function return 16574/head
Donald Sharp [Tue, 13 Aug 2024 12:49:01 +0000 (08:49 -0400)]
bgpd: Free up non-freed json memory on function return

json_peers is allocated in the above if statement block
for json but is not freed in this code path.  Noticed
by running Address Sanitizer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16558 from nabahr/pim_doc
Donald Sharp [Tue, 13 Aug 2024 12:47:27 +0000 (08:47 -0400)]
Merge pull request #16558 from nabahr/pim_doc

doc: Fix up pim user docs.

8 months agoMerge pull request #16557 from donaldsharp/pathd_shutdown_memory_leaks
Donatas Abraitis [Mon, 12 Aug 2024 20:45:32 +0000 (23:45 +0300)]
Merge pull request #16557 from donaldsharp/pathd_shutdown_memory_leaks

pathd: Cleanup shutdown memory leaks

8 months agoMerge pull request #16555 from donaldsharp/agentx_event_leak
Donatas Abraitis [Mon, 12 Aug 2024 20:45:14 +0000 (23:45 +0300)]
Merge pull request #16555 from donaldsharp/agentx_event_leak

lib: Fix memory leak in snmp on shutdown

8 months agodoc: Fix up pim user docs. 16558/head
Nathan Bahr [Mon, 12 Aug 2024 16:00:06 +0000 (16:00 +0000)]
doc: Fix up pim user docs.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
8 months agotests: Fix bgp_duplicate_nexthop python warning 16559/head
Donald Sharp [Mon, 12 Aug 2024 17:55:26 +0000 (13:55 -0400)]
tests: Fix bgp_duplicate_nexthop python warning

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16534 from opensourcerouting/fix/start_ldpd_if_unified
Donald Sharp [Mon, 12 Aug 2024 14:25:54 +0000 (10:25 -0400)]
Merge pull request #16534 from opensourcerouting/fix/start_ldpd_if_unified

doc: Document on how to start specific daemons with unified config in topotests

8 months agopathd: Cleanup shutdown memory leaks 16557/head
Donald Sharp [Mon, 12 Aug 2024 14:14:31 +0000 (10:14 -0400)]
pathd: Cleanup shutdown memory leaks

Just some code to cleanup the shutdown memory leaks
that are in pathd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agolib: Fix memory leak in snmp on shutdown 16555/head
Donald Sharp [Fri, 9 Aug 2024 18:50:59 +0000 (14:50 -0400)]
lib: Fix memory leak in snmp on shutdown

The events list is storing a `struct event *` allocated
as a MTYPE_TMP pointer, on shutdown ensure that it is
properly free'd up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6
Donatas Abraitis [Mon, 12 Aug 2024 12:37:36 +0000 (15:37 +0300)]
Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6

bgpd: fixes for ipv4 mapped ipv6 address

8 months agoMerge pull request #16545 from mjstapp/fix_isis_threeway
Donatas Abraitis [Mon, 12 Aug 2024 06:39:45 +0000 (09:39 +0300)]
Merge pull request #16545 from mjstapp/fix_isis_threeway

isisd: fix memory handling in isis_adj_process_threeway()

8 months agoMerge pull request #16556 from donaldsharp/mgmt_ignore
Donatas Abraitis [Mon, 12 Aug 2024 06:39:22 +0000 (09:39 +0300)]
Merge pull request #16556 from donaldsharp/mgmt_ignore

mgmtd: Add to .gitignore for mgmtd_testc program

8 months agoMerge pull request #16420 from pguibert6WIND/trap_rfc4382
Donatas Abraitis [Mon, 12 Aug 2024 06:38:58 +0000 (09:38 +0300)]
Merge pull request #16420 from pguibert6WIND/trap_rfc4382

bgpd: add bgp snmp traps rfc4382 command

8 months agoMerge pull request #16554 from donaldsharp/zebra_ensure_no_use_after_free
Donatas Abraitis [Mon, 12 Aug 2024 04:59:42 +0000 (07:59 +0300)]
Merge pull request #16554 from donaldsharp/zebra_ensure_no_use_after_free

zebra: Ensure non-equal id's are not same nhg's

8 months agobgpd, doc: add bgp snmp traps rfc4382 command 16420/head
Philippe Guibert [Thu, 18 Jul 2024 12:43:45 +0000 (14:43 +0200)]
bgpd, doc: add bgp snmp traps rfc4382 command

Add a trap command to disable or enable the traps defined by
the RFC4382.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 months agobgpd: Move evpn_overlay to a pointer 16549/head
Donatas Abraitis [Sun, 11 Aug 2024 10:59:13 +0000 (13:59 +0300)]
bgpd: Move evpn_overlay to a pointer

Before this convertion:

```
/* --- cacheline 3 boundary (192 bytes) --- */
struct bgp_attr_encap_subtlv * encap_subtlvs;    /*   192     8 */
struct bgp_attr_encap_subtlv * vnc_subtlvs;      /*   200     8 */
struct bgp_route_evpn      evpn_overlay;         /*   208    36 */
```

After this convertion:

```
/* --- cacheline 3 boundary (192 bytes) --- */
struct bgp_attr_encap_subtlv * encap_subtlvs;    /*   192     8 */
struct bgp_attr_encap_subtlv * vnc_subtlvs;      /*   200     8 */
struct bgp_route_evpn *    evpn_overlay;         /*   208     8 */
```

Saving 28 bytes when EVPN is not used.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>