summaryrefslogtreecommitdiff
path: root/babeld
AgeCommit message (Collapse)Author
2025-04-10babeld: fix incorrect type assignment in parse_request_subtlvzmw12306
parse_request_subtlv accesses type using fixed offset instead of current position. Signed-off-by: zmw12306 <zmw12306@gmail.com> (cherry picked from commit 1571607c6bcba8f6861bdb90f472fe534df78a80)
2025-04-08babeld: check valid babel portzmw12306
Add checking for port == 6696. Signed-off-by: zmw12306 <zmw12306@gmail.com> (cherry picked from commit 6f88868f325f0269198fb8e0c00b40a7bbe0e53f)
2025-01-02babel: Clean babel related config on daemon stopYaroslav Kholod
When deactivating babel no router babel and later re-enabling it router babel the previous configuration is still in place. Steps to reproduce: Enable babel Configure babel Disable babel with "no router babel" Verify config Expected correct behavior: No config present Signed-off-by: Yaroslav Kholod <y.kholod@vyos.io>
2024-12-20babel: Clean babel config on babel daemon stopYaroslav Kholod
When deactivating babel no router babel and later re-enabling it router babel the previous configuration is still in place. Steps to reproduce: - Enable babel - Configure babel - Disable babel with "no router babel" - Verify config Expected correct behavior: No config present Signed-off-by: Yaroslav Kholod <y.kholod@vyos.io>
2024-09-06babeld: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-08-22babeld: Do not remove route when replacingDonald Sharp
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>
2024-08-22babeld: Send the route's metric down to zebra.Donald Sharp
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>
2024-08-13babeld: Free up memory on shutdownDonald Sharp
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>
2024-07-10babel: Added null check after retrieving babel_ifpY Bharath
Asserting the further instructions when the babel interface pointer is NULL Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-02-20babeld: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-02-14babeld: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-02-01*: create a single registry of daemons' default port valuesMark Stapp
Create a single registry of default port values that daemons are using. Most of these are vty ports, but there are some others for features like ospfapi and zebra FPM. Signed-off-by: Mark Stapp <mjs@labn.net>
2024-01-27babeld: remove bogus config path printDavid Lamparter
This doesn't align with what the code actually loads, remove it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27*: fix `frr_daemon_info` indentationDavid Lamparter
clang-format doesn't understand FRR_DAEMON_INFO is a long macro where laying out items semantically makes sense. (Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get confused with the mismatching `( ( )`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27*: rename `frr_vtydir` to `frr_runstatedir`David Lamparter
Also remove frr_init_vtydir(), just initialize to default. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-22babeld: use correct autocompletion for distribute-list commandsIgor Ryzhov
Currently, we always use access-list autocompletion, even if configuring prefix-lists. We should differentiate. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22babeld: pass distribute ctx to distribute-list functionsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22lib: enable multiple instance support with distribute listsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-09*: zebra.h should not have fcntl.hDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-21*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZDonald Sharp
INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ is the standard for interface name length on all platforms that FRR currently compiles on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-16babeld: Free IPv4 Memory in babel_interface_freeKeelan10
Ensure proper memory cleanup by freeing the `babel_ifp->ipv4` when babel interface is deleted. This prevents memory leaks. The ASan leak log for reference: ``` *********************************************************************************** Address Sanitizer Error detected in all_protocol_startup.test_all_protocol_startup/r1.asan.babeld.4141 ================================================================= ==4141==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 10 object(s) allocated from: #0 0x7f1cde6a9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40) #1 0x562b8eff328d in babel_interface_address_add babeld/babel_interface.c:112 #2 0x7f1cde1772cb in zclient_read lib/zclient.c:4425 #3 0x7f1cde14729c in event_call lib/event.c:1980 #4 0x7f1cde08a3bf in frr_run lib/libfrr.c:1214 #5 0x562b8eff481b in main babeld/babel_main.c:202 #6 0x7f1cdd8acc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 40 byte(s) leaked in 10 allocation(s). *********************************************************************************** ``` Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-11-15babeld: Free IPv4 Memory in interface_resetKeelan10
Release memory allocated for the IPv4 address during the interface reset. The addition of `free(babel_ifp->ipv4)` ensures proper cleanup, preventing potential memory leaks. The ASan leak log for reference: ``` *********************************************************************************** Address Sanitizer Error detected in babel_topo1.test_babel_topo1/r2.asan.babeld.18864 ================================================================= ==18864==ERROR: LeakSanitizer: detected memory leaks Direct leak of 8 byte(s) in 2 object(s) allocated from: #0 0x7f3f4531bb40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40) #1 0x55c1806cb28d in babel_interface_address_add babeld/babel_interface.c:112 #2 0x7f3f44de9e29 in zclient_read lib/zclient.c:4425 #3 0x7f3f44db9dfa in event_call lib/event.c:1965 #4 0x7f3f44cfd3bf in frr_run lib/libfrr.c:1214 #5 0x55c1806cc81b in main babeld/babel_main.c:202 #6 0x7f3f4451fc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 8 byte(s) leaked in 2 allocation(s). *********************************************************************************** ``` Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-11-13babeld: Cleanup vrf data structures on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-02lib: convert if_zapi_callbacks into actual hooksDavid Lamparter
...so that multiple functions can be subscribed. The create/destroy hooks are renamed to real/unreal because that's what they *actually* signal. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-07-04Merge pull request #13333 from donaldsharp/vrf_bitmap_cleanupDonatas Abraitis
*: Rearrange vrf_bitmap_X api to reduce memory footprint
2023-06-27Merge pull request #13672 from zmw12306/AE_zeroDonatas Abraitis
babeld: add AE!=0 check when type is 7 or 10.
2023-06-26*: Rearrange vrf_bitmap_X api to reduce memory footprintDonald Sharp
When running all daemons with config for most of them, FRR has sharpd@janelle:~/frr$ vtysh -c "show debug hashtable" | grep "VRF BIT HASH" | wc -l 3570 3570 hashes for bitmaps associated with the vrf. This is a very large number of hashes. Let's do two things: a) Reduce the created size of the actually created hashes to 2 instead of 32. b) Delay generation of the hash *until* a set operation happens. As that no hash directly implies a unset value if/when checked. This reduces the number of hashes to 61 in my setup for normal operation. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-02babeld: add AE!=0 check when type is 7 or 10.zmw12306
Signed-off-by: zmw12306 <zmw12306@gmail.com>
2023-05-02Merge pull request #13354 from zmw12306/parse_request_subtlvRuss White
babeld: add parse_request_subtlv into parse_packet
2023-04-22babeld: ignore nonzero flag bits in Hello TLVszmw12306
Ignore all other bits(except U) in Hello TLVs, according to RFC8966 Signed-off-by: zmw12306 <zmw12306@gmail.com>
2023-04-22babeld: add parse_request_subtlv into parse_packetzmw12306
when type is MESSAGE_REQUEST, babel should be able to handle sub_tlvs Signed-off-by: zmw12306 <zmw12306@gmail.com>
2023-04-04Merge pull request #12837 from donaldsharp/unlikely_routemapRuss White
Unlikely routemap
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_cancelXXX to event_cancelXXXDonald Sharp
Modify the code base so that thread_cancel becomes event_cancel Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-23babeld, lib, nhrpd: Add likely and unlikely macrosDonald Sharp
We have 2 competing versions of likely and unlikely in babeld and nhrpd. Standardize onto lower case versions and consolidate in the code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-03babeld: fix #11808 to avoid infinite loopsharryreps
Replacing continue in loops to goto done so that index of packet buffer increases. Signed-off-by: harryreps <harryreps@gmail.com>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-15Merge pull request #12802 from sri-mohan1/sri-bableDonald Sharp
babeld: changes for code maintainability
2023-02-14babeld: changes for code maintainabilitysri-mohan1
These changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-02-09Merge pull request #12762 from sri-mohan1/sri-bableDonald Sharp
babeld: changes for code maintainability
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09*: sort out & explain licenses used in FRRDavid Lamparter
New "introduction" note in `COPYING`, and all the licenses moved into `doc/licenses/`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-07babeld: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-02-06babeld: Fix filtering against all interfacesYuxiang Zhu
The first argument of `access_list_lookup` and `prefix_list_lookup` should be `AFI_` constants instead of `AF_` constants. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>