Commit graph

38740 commits

Author SHA1 Message Date
Pooja Jagadeesh Doijode 7a935bb1ad zebra: Change zserv_accept to use global zsock FD
Problem:
Zebra crashed while going down. This happened because zebra was
trying to process a new client accept request after closing ZAPI's
listener socket zsock and setting it to -1.

Fix:
Skip rescheduling zserv_accept() and accepting a new client if global
ZAPI listener socket FD, zsock is already closed and set to -1.
Also use global ZAPI listener socket FD zsock in zserv_accept() instead
of using a copy of zsock.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2025-04-25 20:27:38 -07:00
Donald Sharp 12e95e5cb0
Merge pull request #18694 from petrvaganoff/dev
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
bgpd: Fix deref after free in bgp_vrf_unlink
2025-04-22 12:27:00 -04:00
Donald Sharp 114af4ca16
Merge pull request #18698 from y-bharath14/srib-tests-v13
tests: Shadowing the built-in function
2025-04-22 12:23:56 -04:00
Russ White 93f29b595a
Merge pull request #18683 from LabNConsulting/chopps/notif-improve
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
Improve notification selectors (sort, eliminate dups)
2025-04-22 11:27:16 -04:00
Russ White deb473ff1d
Merge pull request #18695 from askorichenko/test-show-advertised-routes-vty
bgpd: fix vty's version of show advertised-routes
2025-04-22 11:09:17 -04:00
Russ White e525972513
Merge pull request #18158 from chdxD1/evpn-no-withdraw-for-update
Update EVPN prefix routes properly instead of withdraw/install
2025-04-22 10:54:57 -04:00
Y Bharath 8cf9900390 tests: Shadowing the built-in function
Shadowing the built-in function in lutil.py

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-22 16:09:23 +05:30
Russ White 87923c8cb0
Merge pull request #18626 from donaldsharp/RA_me
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
Implement RFC8781 (NAT64 prefix in RA's)
2025-04-21 17:32:58 -04:00
Alexander Skorichenko af6fe87d7c bgpd: fix vty's version of show advertised-routes
Fix displayed metric if a route-map is applied to advertised routes

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2025-04-21 21:23:54 +02:00
Donatas Abraitis 1425a43c1b
Merge pull request #18689 from donaldsharp/limit_outgoing_packets
bgpd: ensure that bgp_generate_updgrp_packets shares nicely
2025-04-21 19:29:12 +03:00
Petr Vaganov 765945feed bgpd: Fix deref after free in bgp_vrf_unlink
Found by the static analyzer Svace (ISP RAS): DEREF_AFTER_FREE -
Pointer '&bgp->vrf_id' is dereferenced after the referenced memory
was deallocated by passing as 1st parameter to function 'bgp_unlock'.

Signed-off-by: Petr Vaganov <petrvaganoff@gmail.com>
2025-04-21 20:52:33 +05:00
Christian Hopps ac832fbff0 lib: nb_notif: notification selectors sorted with no dups
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-21 09:22:28 +00:00
Christian Hopps 2dc8d070d6 mgmtd: validate notify selectors to be xpaths that result to nodes
Also, only message interested backend clients about a path removal when last
supporting session is being removed from a given notification path.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-21 09:22:28 +00:00
Christian Hopps ccde9d7ea0 lib: mgmt backend: add refer_id to notification message
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-21 09:22:28 +00:00
Christian Hopps 7d2a0ffc69 lib: darr: add string search macros
Add macros to support searching for and finding (perhaps closest) matches
for a key in an array of strings.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-21 09:22:28 +00:00
Christian Hopps fca333e342 lib: darr: use unique variable names in insert macro
- Missed insert mcaro when fixing the other macros.
- Also, actually use `MT` argument in the mt variant insert macros

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-19 09:38:57 +00:00
Donatas Abraitis 004c6c0260
Merge pull request #18692 from donaldsharp/event_cleanups
zebra: Save event pointer for rib sweeping
2025-04-19 03:40:27 +03:00
Donald Sharp 547894c087 zebra: Save event pointer for rib sweeping
The rib_sweep_route function when not doing graceful
restart does not attempt to save the event on the
t_rib_sweep pointer for shutdown.  Prevent any
weird shenanigans by allowing shutdown to clean
up the rib_sweep_route event.

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2025-04-18 17:44:39 -04:00
Donald Sharp 681caee944 bgpd: ensure that bgp_generate_updgrp_packets shares nicely
The bgp_generate_updgrp_packet function will attempt to write
up to `write quanta 64` packets at one time.  This is extremely
expensive at scale and is causing CPU_HOGS as well as STARVATION
messages.  Check to see if we should yield the CPU to allow
something else in BGP to continue working.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-04-18 13:50:33 -04:00
Donald Sharp 5d4c7d2ece
Merge pull request #18675 from mjstapp/fix_clang_18_warnings
lib,pimd,bgpd,bfdd: Fix clang 18 warnings
2025-04-17 18:38:21 -04:00
Donatas Abraitis 0850ae7db7
Merge pull request #18658 from y-bharath14/srib-tests-v12
tests: Resource leak in common_config.py
2025-04-17 18:18:26 +03:00
Donald Sharp 2892c20097
Merge pull request #18538 from nabahr/autorp-enabling
pimd: Only create and bind the autorp socket when really needed
2025-04-17 10:14:13 -04:00
Mark Stapp 2d42318625 bfdd, bgpd: clean up clang warnings
Clean up some clang compiler warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-16 13:50:21 -04:00
Mark Stapp d378275106 pimd: clean up clang warnings
Clean up clang warnings in pimd; mostly address-of-packed
issues (removed some ugly casts too).

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-16 13:50:21 -04:00
Mark Stapp c65fdc9a49 lib: disable clang warning in parser yacc output
Disable a clang 'unused' warning in the yacc source
of command_parse.c.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-16 13:50:21 -04:00
Jafar Al-Gharaibeh 38968cc8df
Merge pull request #18669 from opensourcerouting/rfapi-misused-conditional
bgpd: fix misused rfapi conditional
2025-04-16 09:39:02 -05:00
Donald Sharp 69a59464ef
Merge pull request #18665 from y-bharath14/srib-yang-v10
yang: Corrected pyang errors in frr-pathd.yang
2025-04-16 09:41:32 -04:00
Mark Stapp 1ca756f315
Merge pull request #18497 from krishna-samy/show-metaq-counters
zebra: show command to display metaq info
2025-04-16 09:16:40 -04:00
Mark Stapp 21a32b010b
Merge pull request #18579 from krishna-samy/krishna/dplane_fpm_read
zebra: change fpm_read to batch the messages
2025-04-16 08:47:11 -04:00
Carmine Scarpitta 42d31854a1
Merge pull request #18667 from louis-6wind/fix-srv6-sid-leak
isisd: fix srv6_sid memory leak
2025-04-16 11:50:09 +00:00
David Lamparter d46909e50f bgpd: fix misused rfapi conditional
bgpd/bgpd.c:8975:5: error: "ENABLE_BGP_VNC" is not defined, evaluates to 0 [-Werror=undef]
 8975 | #if ENABLE_BGP_VNC

Fixes: FRRouting#18546
Fixes: 1629c05924 ("bgpd: rfapi: track outstanding rib and import timers, free mem at exit")
Cc: G. Paul Ziemba <paulz@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-04-16 12:47:36 +02:00
Louis Scalbert 25c813ac38 isisd: fix srv6_sid memory leak
Seen with isis_srv6_topo1 topotest.

> ==178793==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 56 byte(s) in 1 object(s) allocated from:
>     #0 0x7f3f63cb4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>     #1 0x7f3f6366f8dd in qcalloc lib/memory.c:105
>     #2 0x561b810c62b7 in isis_srv6_sid_alloc isisd/isis_srv6.c:243
>     #3 0x561b8111f944 in isis_zebra_srv6_sid_notify isisd/isis_zebra.c:1534
>     #4 0x7f3f637df9d7 in zclient_read lib/zclient.c:4845
>     #5 0x7f3f637779b2 in event_call lib/event.c:2011
>     #6 0x7f3f63642ff1 in frr_run lib/libfrr.c:1216
>     #7 0x561b81018bf2 in main isisd/isis_main.c:360
>     #8 0x7f3f63029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Fixes: 0af0f4616d ("isisd: Receive SRv6 SIDs notifications from zebra")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-04-16 11:28:01 +02:00
David Lamparter 336fe6728f
Merge pull request #18662 from mjstapp/fix_test_nb_endian 2025-04-16 10:49:13 +02:00
Y Bharath eff5a9023a yang: Corrected pyang errors in frr-pathd.yang
Corrected pyang warnings and errors in frr-pathd.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-16 12:47:31 +05:30
Krishnasamy 7e8c18d0b0 zebra: change fpm_read to batch the messages
Make code changes in fpm_read to create a list of ctx and send it to
zebra for processing rather than sending individual ctx

Signed-off-by: Krishnasamy <krishnasamyr@nvidia.com>
2025-04-16 07:14:55 +00:00
Mark Stapp b256f2f1e9 tests: add nb test binary to .gitignore
Add a northbound unit-test binary product to .gitignore

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-15 13:16:07 -04:00
Mark Stapp da8fce3830 tests: use little-endian order for libyang api
Use the expected - little-endian - byte-order for a param
to one of the libyang apis; tests fail on LE architectures
otherwise.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-15 13:15:09 -04:00
Russ White e190163413
Merge pull request #18592 from zmw12306/bfd_set_shutdown
bfdd: Set bfd.LocalDiag when transitioning to AdminDown
2025-04-15 11:34:28 -04:00
Russ White 796e1af6e2
Merge pull request #18540 from LabNConsulting/chopps/list-entry-done
lib: nb: add list_entry_done() callback to free resources
2025-04-15 11:30:50 -04:00
Christian Hopps f5a8b8aedf
Merge pull request #18610 from lsang6WIND/yang-isisd
fix yang commands that don't have yang attr
2025-04-15 10:25:51 -05:00
Donald Sharp fd9ff5e0e2 tests: Add ability to test ipv6 ra pref64 extension
This is the test to ensure that the ipv6 ra pref64
extension is working properly..

This is a very simple test.  Enables the feature
on r1 to send out the ra's once every 3 seconds
with the feature turned on.  Then on r2 ensure
that we see the ra with the appropriate values.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-04-15 14:20:28 +02:00
David Lamparter 5fd36a5818 tests: add external RFC8781 receiver tool
Otherwise pretty much impossible to test this within the current
limitations of topotests.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-04-15 14:20:23 +02:00
David Lamparter 38ea0258ae zebra: implement RFC8781 (NAT64 prefix in RAs)
This tells hosts on the subnet if (and which) NAT64 prefix is in use.
Useful for things like xlat464, or local dns64.

Updated from the previous -03 draft implementation.  (PLC field did not
exist before.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-04-15 14:20:05 +02:00
Donatas Abraitis 7ef9394c33
Merge pull request #18653 from louis-6wind/fix-bgp-pbr-mem-leaks
bgpd: fix pbr memory leaks
2025-04-15 10:07:14 +03:00
Y Bharath bb6f2c2fb0 tests: Resource leak in common_config.py
Address pending changes from PR:18574

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-15 11:24:44 +05:30
Jafar Al-Gharaibeh 3da1473093
Merge pull request #18655 from mjstapp/fix_clang_lib_bgp
lib,bgpd: clean up clang warnings
2025-04-14 21:10:49 -05:00
Donald Sharp 417c82aadd
Merge pull request #18654 from chdxD1/v4-via-v6-nexthop
Add v4-via-v6 nexthop support to staticd
2025-04-14 19:28:48 -04:00
Jafar Al-Gharaibeh 0dc71bcfca
Merge pull request #18641 from donaldsharp/fpm_listener_storage
zebra: Add ability to dump routes received from fpm_listener
2025-04-14 15:21:13 -05:00
Mark Stapp 81b472bd79 lib,bgpd: clean up clang warnings
Clean up a couple of clang compiler warnings (this was
clang 18)

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-14 15:32:08 -04:00
Jafar Al-Gharaibeh c2ee9a360e
Merge pull request #18578 from ak503/pim6_use_source
pim6d: fix missing 'use-source' interface command
2025-04-14 14:07:26 -05:00