Commit Graph

35921 Commits

Author SHA1 Message Date
Donatas Abraitis
13460af422
Merge pull request #16239 from FRRouting/mergify/bp/dev/10.1/pr-16224
zebra: Prevent starvation in dplane_thread_loop (backport #16224)
2024-06-25 13:47:33 +03:00
Jafar Al-Gharaibeh
ecf1bc08ad
Merge pull request #16274 from FRRouting/mergify/bp/dev/10.1/pr-16242
bgpd: Set last reset reason to admin shutdown if it was manually (backport #16242)
2024-06-25 01:25:25 -04:00
Francois Dumontet
1488b47e84 tests: improve tests for aspath exclude and bgp access list
add some match in route map rules
add some set unset bgp access path list
add another prefix for better tests discrimination
update expected results

Signed-off-by:  Francois Dumontet <francois.dumontet@6wind.com>
(cherry picked from commit 0df2e14997)
2024-06-25 05:12:09 +00:00
Francois Dumontet
c05a11df9e bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues
whith the following config

router bgp 65001
 no bgp ebgp-requires-policy
 neighbor 192.168.1.2 remote-as external
 neighbor 192.168.1.2 timers 3 10
 !
 address-family ipv4 unicast
  neighbor 192.168.1.2 route-map r2 in
 exit-address-family
exit
!
bgp as-path access-list FIRST seq 5 permit ^65
bgp as-path access-list SECOND seq 5 permit 2$
!
route-map r2 permit 6
 match ip address prefix-list p2
 set as-path exclude as-path-access-list SECOND
exit
!
route-map r2 permit 10
 match ip address prefix-list p1
 set as-path exclude 65003
exit
!
route-map r2 permit 20
 match ip address prefix-list p3
 set as-path exclude all
exit

making some
no bgp as-path access-list SECOND permit 2$
bgp as-path access-list SECOND permit 3$

clear bgp *

no bgp as-path access-list SECOND permit 3$
bgp as-path access-list SECOND permit 2$

clear bgp *

will induce some crashes

thus  we rework the links between aslists and aspath_exclude

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
(cherry picked from commit 094dcc3cda)
2024-06-25 05:12:09 +00:00
Sindhu Parvathi Gopinathan
3bc367453d zebra: clear evpn dup-addr return error-msg when there is no vni
clear evpn dup-addr cli returns error-msg for below conditions,

 - If evpn is not enabled &
 - If there is no VNI exists.

supported command:

```
clear evpn dup-addr vni <vni-id>
```

Ticket: #3495573

Testing:

bharat# clear evpn dup-addr vni all
Error type: validation
Error description: % EVPN not enabled

bharat# clear evpn dup-addr vni 20
Error type: validation
Error description: % VNI 20 does not exist

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 56c16ee529)
2024-06-25 05:08:02 +00:00
Donatas Abraitis
b98a3a1fa8 bgpd: Check if we have really enough data before doing memcpy for FQDN capability
We advance data pointer (data++), but we do memcpy() with the length that is 1-byte
over, which is technically heap overflow.

```
==411461==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x50600011da1a at pc 0xc4f45a9786f0 bp 0xffffed1e2740 sp 0xffffed1e1f30
READ of size 4 at 0x50600011da1a thread T0
    0 0xc4f45a9786ec in __asan_memcpy (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x3586ec) (BuildId: e794c5f796eee20c8973d7efb9bf5735e54d44cd)
    1 0xc4f45abf15f8 in bgp_dynamic_capability_fqdn /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3457:4
    2 0xc4f45abdd408 in bgp_capability_msg_parse /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3911:4
    3 0xc4f45abdbeb4 in bgp_capability_receive /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3980:9
    4 0xc4f45abde2cc in bgp_process_packet /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:4109:11
    5 0xc4f45a9b6110 in LLVMFuzzerTestOneInput /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_main.c:582:3
```

Found by fuzzing.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b685ab5e1b)
2024-06-24 20:41:15 +00:00
Donatas Abraitis
9f1e1eb142 bgpd: Check if we have really enough data before doing memcpy for software version
If we receive CAPABILITY message (software-version), we SHOULD check if we really
have enough data before doing memcpy(), that could also lead to buffer overflow.

(data + len > end) is not enough, because after this check we do data++ and later
memcpy(..., data, len). That means we have one more byte.

Hit this through fuzzing by

```
    0 0xaaaaaadf872c in __asan_memcpy (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x35872c) (BuildId: 9c6e455d0d9a20f5a4d2f035b443f50add9564d7)
    1 0xaaaaab06bfbc in bgp_dynamic_capability_software_version /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3713:3
    2 0xaaaaab05ccb4 in bgp_capability_msg_parse /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3839:4
    3 0xaaaaab05c074 in bgp_capability_receive /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3980:9
    4 0xaaaaab05e48c in bgp_process_packet /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:4109:11
    5 0xaaaaaae36150 in LLVMFuzzerTestOneInput /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_main.c:582:3
```

Hit this again by Iggy \m/

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 5d7af51c4f)
2024-06-24 20:40:00 +00:00
Donatas Abraitis
dc98037015 bgpd: Remove redundant whitespace before printing the reason of the failed peer
Before:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never  Waiting for peer OPEN (n/a)
```

After:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never Waiting for peer OPEN (n/a)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b5bd626a82)
2024-06-24 19:41:41 +00:00
Donatas Abraitis
348063bbde bgpd: Set last reset reason to admin shutdown if it was manually
Before this patch, we always printed the last reason "Waiting for OPEN", but
if it's a manual shutdown, then we technically are not waiting for OPEN.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit c25c7e929d)
2024-06-24 19:41:41 +00:00
Donatas Abraitis
325c63c6ad
Merge pull request #16255 from FRRouting/mergify/bp/dev/10.1/pr-16059
bgpd: fixed failing to remove VRF if there is a stale l3vni (backport #16059)
2024-06-21 17:51:43 +03:00
Donatas Abraitis
8ef8743e6c
Merge pull request #16264 from FRRouting/mergify/bp/dev/10.1/pr-16252
zebra: fix evpn mh bond member proto reinstall (backport #16252)
2024-06-21 17:50:52 +03:00
Donatas Abraitis
1787c35d23
Merge pull request #16262 from FRRouting/mergify/bp/dev/10.1/pr-16260
bgpd: fix do not use api.backup_nexthop in ZAPI message (backport #16260)
2024-06-21 17:50:20 +03:00
Chirag Shah
e33bdc00f7 zebra: fix evpn mh bond member proto reinstall
In case of EVPN MH bond, a member port going in
protodown state due to external reason (one case being linkflap),
frr updates the state correctly but upon manually
clearing external reason trigger FRR to reinstate
protodown without any reason code.

Fix is to ensure if the protodown reason was external
and new state is to have protodown 'off' then do no reinstate
protodown.

Ticket: #3947432
Testing:
switch:#ip link show swp1
4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 9216 qdisc
   pfifo_fast master bond1 state DOWN mode DEFAULT group default qlen
   1000
       link/ether 1c:34:da:2c:aa:68 brd ff:ff:ff:ff:ff:ff protodown on
       protodown_reason <linkflap>

switch:#ip link set swp1 protodown off protodown_reason linkflap off
switch:#ip link show swp1
 4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 9216 qdisc
    pfifo_fast master bond1 state DOWN mode DEFAULT group default qlen
    1000
        link/ether 1c:34:da:2c:aa:68 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit e4d843b438)
2024-06-21 06:46:57 +00:00
Philippe Guibert
7bb66b83b0 bgpd: fix do not use api.backup_nexthop in ZAPI message
The backup_nexthop entry list has been populated by mistake,
and should not. Fix this by reverting the introduced behavior.

Fixes: 237ebf8d45 ("bgpd: rework bgp_zebra_announce() function, separate nexthop handling")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit d4390fc217)
2024-06-21 06:44:39 +00:00
Kacper Kwaśny
7749253e8c bgpd: fixed failing remove of vrf if there is a stale l3vni
Problem statement:
==================
When a vrf is deleted from the kernel, before its removed from the FRR
config, zebra gets to delete the the vrf and assiciated state.

It does so by sending a request to delete the l3 vni associated with the
vrf followed by a request to delete the vrf itself.

2023/10/06 06:22:18 ZEBRA: [JAESH-BABB8] Send L3_VNI_DEL 1001 VRF
testVRF1001 to bgp
2023/10/06 06:22:18 ZEBRA: [XC3P3-1DG4D] MESSAGE: ZEBRA_VRF_DELETE
testVRF1001

The zebra client communication is asynchronous and about 1/5 cases the
bgp client process them in a different order.

2023/10/06 06:22:18 BGP: [VP18N-HB5R6] VRF testVRF1001(766) is to be
deleted.
2023/10/06 06:22:18 BGP: [RH4KQ-X3CYT] VRF testVRF1001(766) is to be
disabled.
2023/10/06 06:22:18 BGP: [X8ZE0-9TS5H] VRF disable testVRF1001 id 766
2023/10/06 06:22:18 BGP: [X67AQ-923PR] Deregistering VRF 766
2023/10/06 06:22:18 BGP: [K52W0-YZ4T8] VRF Deletion:
testVRF1001(4294967295)
.. and a bit later :
2023/10/06 06:22:18 BGP: [MRXGD-9MHNX] DJERNAES: process L3VNI 1001 DEL
2023/10/06 06:22:18 BGP: [NCEPE-BKB1G][EC 33554467] Cannot process L3VNI
1001 Del - Could not find BGP instance

When the bgp vrf config is removed later it fails on the sanity check if
l3vni is removed.

        if (bgp->l3vni) {
            vty_out(vty, "%% Please unconfigure l3vni %u\n",
                bgp->l3vni);
            return CMD_WARNING_CONFIG_FAILED;
        }

Solution:
=========
The solution is to make bgp cleanup the l3vni a bgp instance is going
down.

The fix:
========
The fix is to add a function in bgp_evpn.c to be responsible for for
deleting the local vni, if it should be needed, and call the function
from bgp_instance_down().

Testing:
========
Created a test, which can run in container lab that remove the vrf on
the host before removing the vrf and the bgp config form frr. Running
this test in a loop trigger the problem 18 times of 100 runs. After the
fix it did not fail.

To verify the fix a log message (which is not in the code any longer)
were used when we had a stale l3vni and needed to call
bgp_evpn_local_l3vni_del() to do the cleanup. This were hit 20 times in
100 test runs.

Signed-off-by: Kacper Kwasny <kkwasny@akamai.com>

bgpd: braces {} are not necessary for single line block

Signed-off-by: Kacper Kwasny <kkwasny@akamai.com>
(cherry picked from commit 171d2583d0)
2024-06-20 07:51:56 +00:00
Donald Sharp
6d1023a712 zebra: Prevent starvation in dplane_thread_loop
When removing a large number of routes, the linux kernel can take the
cpu for an extended amount of time, leaving a situation where FRR
detects a starvation event.

r1# sharp install routes 10.0.0.0 nexthop 192.168.44.33 1000000 repeat 10
2024-06-14 12:55:49.365 [NTFY] sharpd: [M7Q4P-46WDR] vty[5]@# sharp install routes 10.0.0.0 nexthop 192.168.44.33 1000000 repeat 10
2024-06-14 12:55:49.365 [DEBG] sharpd: [YP4TQ-01TYK] Inserting 1000000 routes
2024-06-14 12:55:57.256 [DEBG] sharpd: [TPHKD-3NYSB] Installed All Items 7.890085
2024-06-14 12:55:57.256 [DEBG] sharpd: [YJ486-NX5R1] Removing 1000000 routes
2024-06-14 12:56:07.802 [WARN] zebra: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task dplane_thread_loop (634377bc8f9e) ran for 7078ms (cpu time 220ms)
2024-06-14 12:56:25.039 [DEBG] sharpd: [WTN53-GK9Y5] Removed all Items 27.783668
2024-06-14 12:56:25.039 [DEBG] sharpd: [YP4TQ-01TYK] Inserting 1000000 routes
2024-06-14 12:56:32.783 [DEBG] sharpd: [TPHKD-3NYSB] Installed All Items 7.743524
2024-06-14 12:56:32.783 [DEBG] sharpd: [YJ486-NX5R1] Removing 1000000 routes
2024-06-14 12:56:41.447 [WARN] zebra: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task dplane_thread_loop (634377bc8f9e) ran for 5175ms (cpu time 179ms)

Let's modify the loop in dplane_thread_loop such that after a provider
has been run, check to see if the event should yield, if so, stop
and reschedule this for the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 6faad863f3)
2024-06-19 07:23:26 +00:00
Jafar Al-Gharaibeh
212a75eca9
Merge pull request #16210 from LabNConsulting/chopps/fix-bug
lib: fix incorrect use of error checking macro
2024-06-13 00:14:16 -05:00
Christian Hopps
07090ccf5a lib: fix incorrect use of error checking macro
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-12 18:48:19 -04:00
Donatas Abraitis
8dac2215ed
Merge pull request #16191 from pguibert6WIND/srte_color_not_copied
lib: fix copy srte_color from zapi_nexthop structure
2024-06-12 15:39:10 +03:00
Russ White
82dcb1d63e
Merge pull request #16190 from trots/master
doc: Add reloading script into Python dependency section
2024-06-11 14:44:14 -04:00
Russ White
b436e96853
Merge pull request #16050 from rgirada/ospfv3_helper
ospf6d: Handling Topo Change in GR-HELPER mode for max-age lsas
2024-06-11 11:48:05 -04:00
Alexander Trotsenko
ee8b65f23b doc: Add reloading script into Python dependency section
Signed-off-by: Alexander Trotsenko <trotsenko93@mail.ru>
2024-06-11 15:23:24 +00:00
Russ White
89afc70b55
Merge pull request #16193 from opensourcerouting/fix/ecommunity_linkbw_present_overrun
bgpd: Check against extended community unit size for link bandwidth
2024-06-11 11:21:42 -04:00
Donald Sharp
d0bdbd129e
Merge pull request #16187 from opensourcerouting/isis_tilfa_topo_rework
isis_tilfa_topo1 rework
2024-06-11 09:49:35 -04:00
Donatas Abraitis
e7bc47b501 bgpd: Check against extended community unit size for link bandwidth
If we receive a malformed packets, this could lead ptr_get_be64() reading
the packets more than needed (heap overflow).

```
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
    0 0xaaaaaadf86ec in __asan_memcpy (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x3586ec) (BuildId: 78123cd26ada92b8b59fc0d74d292ba70c9d2e01)
    1 0xaaaaaaeb60fc in ptr_get_be64 /home/ubuntu/frr-public/frr_public_private-libfuzzer/./lib/stream.h:377:2
    2 0xaaaaaaeb5b90 in ecommunity_linkbw_present /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_ecommunity.c:1895:10
    3 0xaaaaaae50f30 in bgp_attr_ext_communities /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_attr.c:2639:8
    4 0xaaaaaae49d58 in bgp_attr_parse /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_attr.c:3776:10
    5 0xaaaaab063260 in bgp_update_receive /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:2371:20
    6 0xaaaaab05df00 in bgp_process_packet /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:4063:11
    7 0xaaaaaae36110 in LLVMFuzzerTestOneInput /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_main.c:582:3
```

This is triggered when receiving such a packet (malformed):

```
(gdb) bt
0  ecommunity_linkbw_present (ecom=0x555556287990, bw=bw@entry=0x7fffffffda68)
    at bgpd/bgp_ecommunity.c:1802
1  0x000055555564fcac in bgp_attr_ext_communities (args=0x7fffffffd840) at bgpd/bgp_attr.c:2619
2  bgp_attr_parse (peer=peer@entry=0x55555628cdf0, attr=attr@entry=0x7fffffffd960, size=size@entry=20,
    mp_update=mp_update@entry=0x7fffffffd940, mp_withdraw=mp_withdraw@entry=0x7fffffffd950)
    at bgpd/bgp_attr.c:3755
3  0x00005555556aa655 in bgp_update_receive (connection=connection@entry=0x5555562aa030,
    peer=peer@entry=0x55555628cdf0, size=size@entry=41) at bgpd/bgp_packet.c:2324
4  0x00005555556afab7 in bgp_process_packet (thread=<optimized out>) at bgpd/bgp_packet.c:3897
5  0x00007ffff7ac2f73 in event_call (thread=thread@entry=0x7fffffffdc70) at lib/event.c:2011
6  0x00007ffff7a6fb90 in frr_run (master=0x555555bc7c90) at lib/libfrr.c:1212
7  0x00005555556457e1 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:543
(gdb) p *ecom
$1 = {refcnt = 1, unit_size = 8 '\b', disable_ieee_floating = false, size = 2, val = 0x555556282150 "",
  str = 0x5555562a9c30 "UNK:0, 255 UNK:2, 6"}
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-11 10:03:17 +03:00
Donatas Abraitis
d5b0c76edd
Merge pull request #16183 from LabNConsulting/chopps/notif-doc-update
mgmtd: add empty notif xpath map for completeness
2024-06-10 22:25:10 +03:00
Renato Westphal
dc354cbfef tests: introduce method to update reference data in isis_tilfa_topo1
The isis_tilfa_topo1 topotest is comprehensive and contains a large
amount of reference data. One problem is that, when changes occur,
updating this reference data can be difficult.

To address this problem, this commit introduces a method to
automatically regenerate the reference data by setting the `REGEN_DATA`
environment variable.

Usage:
$ REGEN_DATA=true python3 ./test_isis_tilfa_topo1.py

When `REGEN_DATA` is set, the topotest regenerates reference data
from the current run instead of comparing against existing reference
data. Note that regenerated data must be manually verified for
correctness.

This commit also simplifies the reference data by replacing all diff
files with complete JSON snapshots.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2024-06-10 12:28:01 -03:00
Renato Westphal
04655c5f74 tests: rework isis_tilfa_topo1 to fix timing issues
In this topotest, steps 10-15 were added to test the IS-IS switchover
functionality. In short, two cases were tested: switchover after a
link down event and switchover after a BFD down event. Both cases
were tested in sequence on the same router, rt6. This involved the
following steps:
- Setting the SPF delay timer to 15 seconds
- Shutting down the eth-rt5 interface from the switch side
- Testing the post-switchover RIB and LIB (triggered by the link down
  event)
- Testing the post-SPF RIB and LIB
- Bringing the eth-rt5 interface back up
- Configuring a BFD session between rt6 and rt5
- Shutting down the eth-rt5 interface from the switch side once again
- Testing the post-switchover RIB and LIB (triggered by the BFD down
  event)
- Testing the post-SPF RIB and LIB

Since the time window to test the post-switchover RIB and LIB was too
narrow (10 seconds), these tests were having sporadic failures.

To resolve this problem, we can simplify the switchover test as follows:
- Setting the SPF delay timer to 60 seconds (not 15)
- Disabling "link-detect" on rt6's eth-rt5 interface
- Shutting down the eth-rt5 interface from the switch side
- On rt6, testing the post-switchover RIB and LIB (triggered by the
  BFD down event)
- On rt5, testing the post-switchover RIB and LIB (triggered by the
  link down event)

Notice how we can test both post-link-down and post-BFD-down switchover
cases simultaneously by having different "link-detect" configurations
on rt5 and rt6. Additionally, by using a larger SPF delay timer, the
time window to test the post-switchover RIB and LIB is much larger
and less prone to sporadic failures.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2024-06-10 12:28:01 -03:00
Philippe Guibert
49bc1b6c21 lib: fix copy srte_color from zapi_nexthop structure
When switching from nexthop to zapi_nexthop, the srte color
is copied. Do the same in reverse.

Fixes: 31f937fb43 ("lib, zebra: Add SR-TE policy infrastructure to zebra")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-10 12:13:56 +02:00
Donatas Abraitis
19c3e0eca6
Merge pull request #16093 from louis-6wind/fix-show-route-memory
zebra: fix Out Of Memory issue when displaying large route tables in JSON
2024-06-10 11:26:23 +03:00
Donald Sharp
f0bf36d2e6
Merge pull request #16189 from LabNConsulting/chopps/triage-github-action 2024-06-08 21:34:42 -04:00
Christian Hopps
e973c1dd48 ci: do apt-get update before installing required modules
- Use `uname -r` to also install specific module versions since
  with github runners the running kernel can become out-dated with
  the deployed packages.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-08 17:29:19 -04:00
Donald Sharp
2a00a648f1
Merge pull request #15900 from mikemallin/v6-vtep-lib-upstream
lib, bgpd, tests, zebra: prefix_sg changes for V6 VTEP
2024-06-07 14:34:11 -04:00
Christian Hopps
491e608c55 doc: add some text on native message API and notif xpath array
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-07 05:50:10 -04:00
Christian Hopps
a1dd57b649 mgmtd: add empty notif xpath map for completeness
New back-end clients may need to add notification static allocations so
we should have it available for those users, rather than requiring the
new user delve into the mgmtd infra and modify it themselves.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-07 05:50:10 -04:00
Louis Scalbert
2d6dcc0c57 tests: check show route vrf all json output
Check that "show ip route vrf XXX json" and the JSON at key "XXX" of
"show ip route vrf all json" gives the same output.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:13:32 +02:00
Louis Scalbert
85eb60ffd6 zebra: fix show route memory consumption
When displaying a route table in JSON, a table JSON object is storing
all the prefix JSON objects containing the prefix information. This
results in excessive memory allocation for JSON objects, potentially
leading to an out-of-memory error on the machine with large routing
tables.

To Fix the memory consumption issue for the "show ip[v6] route [vrf XX]
json" command, display the prefixes one by one and free the memory of
each JSON object after it has been displayed.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:13:32 +02:00
Louis Scalbert
cb440058f2 zebra: fix show route vrf all memory consumption
0e2fc3d67f ("vtysh, zebra: Fix malformed json output for multiple vrfs
in command 'show ip route vrf all json'") has been reverted in the
previous commit. Although the fix was correct, it was consuming too muca
memory when displaying large route tables.

A root JSON object was storing all the JSON objects containing the route
tables, each containing their respective prefixes in JSON objects. This
resulted in excessive memory allocation for JSON objects, potentially
leading to an out-of-memory error on the machine.

To Fix the memory consumption issue for the "show ip[v6] route vrf all
json" command, display the tables one by one and free the memory of each
JSON object after it has been displayed.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:13:32 +02:00
Louis Scalbert
03b1ee7a39 lib: add helpers to print json keys
Add helpers to print json keys in order to prepare the next commits.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:13:26 +02:00
Louis Scalbert
0c6f14ec14 Revert "vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route vrf all json'"
This reverts commit 0e2fc3d67f.

This fix was correct but not optimal for memory consumption at scale.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:12:42 +02:00
Donatas Abraitis
0cbe6dfc08
Merge pull request #16143 from eremcan/patch-1
docker: fix chmod issues when running container for debian
2024-06-07 10:49:55 +03:00
Russ White
64f447fb10
Merge pull request #11906 from louis-6wind/show_isis_db_json
isisd: fix show isis database [detail] json
2024-06-06 16:27:57 -04:00
Russ White
84af49b0ae
Merge pull request #15434 from louis-6wind/labels-hash
bgpd: move labels from extra to extra->labels and add them to adj-rib-in and adj-rib-out
2024-06-06 16:27:38 -04:00
Donald Sharp
b70a773aa6
Merge pull request #16151 from pguibert6WIND/srv6_fix_source_address
zebra: display srv6 encapsulation source-address when configured
2024-06-06 12:22:15 -04:00
Donald Sharp
e1e84a70a0
Merge pull request #16171 from mjstapp/fix_fpm_nl_len_check
zebra: fix incoming FPM message length validation
2024-06-06 08:20:53 -04:00
Donald Sharp
3962ec5338
Merge pull request #16176 from LabNConsulting/chopps/munet-version-update
tests: munet: update to version 0.14.9
2024-06-06 08:20:37 -04:00
Rajesh Girada
a41b484f0a ospf6d: Handling Topo Change in GR-HELPER mode for max-age lsas
Description:
OSPF6 GR HELPER router should  consider as TOPOCHANGE when
it receives lsas with max age and should exit from Helper.
But, it is not exiting from helper because this max age lsa is
considered as duplicated lsa since the sender uses same seq
number for max age lsa from the previous lsa update.
Currently, topo change is not considered for duplicated lsas.
So removed the duplicated check when validating TOPOCHNAGE.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2024-06-06 04:34:39 -07:00
Christian Hopps
a465000035 tests: munet: update to version 0.14.9
Topotest relevant changes:

    - add support for `timeout` arg to `cmd_*()`
    - handle invalid regexp in CLI commands
    - fix long interface name support

Full munet changelog:

    munet: 0.14.9: add support for `timeout` arg to `cmd_*()`
    munet: 0.14.8: cleanup the cleanup (kill) on launch options
    munet: 0.14.7: allow multiple extra commands for shell console init
    munet: 0.14.6:
      - qemu: gather gcda files where munet can find them
      - handle invalid regexp in CLI commands
    munet: 0.14.5:
      - (podman) pull missing images for containers
      - fix long interface name support
      - add another router example
    munet: 0.14.4: mutest: add color to PASS/FAIL indicators on tty consoles
    munet: 0.14.3: Add hostnet node that runs it's commands in the host network namespace.
    munet: 0.14.2:
      - always fail mutest tests on bad json inputs
      - improve ssh-remote for common use-case of connecting to host connected devices
      - fix ready-cmd for python v3.11+
    munet: 0.14.1: Improved host interface support.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 08:50:05 +00:00
Donald Sharp
fbc795a047
Merge pull request #16170 from LabNConsulting/dleroy/nhrpd-shortcut-cleanup
nhrpd: cleans up shortcut cache entries on termination
2024-06-05 14:39:14 -04:00
Mark Stapp
28d2e126c7 zebra: fix incoming FPM message length validation
Validate incoming message length against correct
(struct rtmsg) len, not top-level netlink message header size.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-06-05 14:37:41 -04:00