summaryrefslogtreecommitdiffstats
path: root/babeld (follow)
Commit message (Collapse)AuthorAgeFilesLines
* babel: Clean babel related config on daemon stopYaroslav Kholod2025-01-021-0/+7
| | | | | | | | | | | | | | | 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>
* babel: Clean babel config on babel daemon stopYaroslav Kholod2024-12-201-0/+6
| | | | | | | | | | | | | | | 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>
* babeld: changes for code maintainabilitysri-mohan12024-09-065-20/+21
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* babeld: Do not remove route when replacingDonald Sharp2024-08-221-6/+2
| | | | | | | | 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>
* babeld: Send the route's metric down to zebra.Donald Sharp2024-08-221-1/+1
| | | | | | | | 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>
* babeld: Free up memory on shutdownDonald Sharp2024-08-135-4/+10
| | | | | | | 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>
* babel: Added null check after retrieving babel_ifpY Bharath2024-07-101-3/+18
| | | | | | | Asserting the further instructions when the babel interface pointer is NULL Signed-off-by: y-bharath14 <y.bharath@samsung.com>
* babeld: changes for code maintainabilitysri-mohan12024-02-191-39/+28
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* babeld: changes for code maintainabilitysri-mohan12024-02-131-81/+55
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* *: create a single registry of daemons' default port valuesMark Stapp2024-02-011-1/+0
| | | | | | | | 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>
* babeld: remove bogus config path printDavid Lamparter2024-01-271-2/+1
| | | | | | This doesn't align with what the code actually loads, remove it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix `frr_daemon_info` indentationDavid Lamparter2024-01-271-7/+9
| | | | | | | | | | 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>
* *: rename `frr_vtydir` to `frr_runstatedir`David Lamparter2024-01-271-2/+2
| | | | | | Also remove frr_init_vtydir(), just initialize to default. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* babeld: use correct autocompletion for distribute-list commandsIgor Ryzhov2024-01-221-8/+52
| | | | | | | Currently, we always use access-list autocompletion, even if configuring prefix-lists. We should differentiate. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* babeld: pass distribute ctx to distribute-list functionsIgor Ryzhov2024-01-221-5/+8
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* lib: enable multiple instance support with distribute listsChristian Hopps2024-01-221-4/+5
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* *: zebra.h should not have fcntl.hDonald Sharp2024-01-092-0/+3
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: convert `struct interface->connected` to DLISTDavid Lamparter2023-11-222-3/+1
| | | | | | | | | | | | | | | | | 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>
* *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZDonald Sharp2023-11-211-1/+1
| | | | | | | | 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>
* babeld: Free IPv4 Memory in babel_interface_freeKeelan102023-11-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* babeld: Free IPv4 Memory in interface_resetKeelan102023-11-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* babeld: Cleanup vrf data structures on shutdownDonald Sharp2023-11-131-0/+2
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib: convert if_zapi_callbacks into actual hooksDavid Lamparter2023-11-031-2/+4
| | | | | | | | | ...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>
* Merge pull request #13333 from donaldsharp/vrf_bitmap_cleanupDonatas Abraitis2023-07-041-8/+8
|\ | | | | *: Rearrange vrf_bitmap_X api to reduce memory footprint
| * *: Rearrange vrf_bitmap_X api to reduce memory footprintDonald Sharp2023-06-261-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #13672 from zmw12306/AE_zeroDonatas Abraitis2023-06-271-2/+2
|\ \ | |/ |/| babeld: add AE!=0 check when type is 7 or 10.
| * babeld: add AE!=0 check when type is 7 or 10.zmw123062023-06-021-2/+2
| | | | | | | | Signed-off-by: zmw12306 <zmw12306@gmail.com>
* | Merge pull request #13354 from zmw12306/parse_request_subtlvRuss White2023-05-023-2/+96
|\ \ | |/ |/| babeld: add parse_request_subtlv into parse_packet
| * babeld: add parse_request_subtlv into parse_packetzmw123062023-04-223-2/+96
| | | | | | | | | | when type is MESSAGE_REQUEST, babel should be able to handle sub_tlvs Signed-off-by: zmw12306 <zmw12306@gmail.com>
* | babeld: ignore nonzero flag bits in Hello TLVszmw123062023-04-221-12/+0
|/ | | | | Ignore all other bits(except U) in Hello TLVs, according to RFC8966 Signed-off-by: zmw12306 <zmw12306@gmail.com>
* Merge pull request #12837 from donaldsharp/unlikely_routemapRuss White2023-04-043-38/+37
|\ | | | | Unlikely routemap
| * babeld, lib, nhrpd: Add likely and unlikely macrosDonald Sharp2023-03-233-38/+37
| | | | | | | | | | | | | | | | 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>
* | *: Convert event.h to frrevent.hDonald Sharp2023-03-242-2/+2
| | | | | | | | | | | | | | We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert `struct event_master` to `struct event_loop`Donald Sharp2023-03-242-2/+2
| | | | | | | | | | | | Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert struct thread_master to struct event_master and it's ilkDonald Sharp2023-03-242-2/+2
| | | | | | | | | | | | | | Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_cancelXXX to event_cancelXXXDonald Sharp2023-03-241-3/+3
| | | | | | | | | | | | Modify the code base so that thread_cancel becomes event_cancel Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-4/+8
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Rename `struct thread` to `struct event`Donald Sharp2023-03-242-8/+8
| | | | | | | | | | | | | | | | | | 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>
* | *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-242-2/+2
|/ | | | | | | | | | | 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>
* babeld: fix #11808 to avoid infinite loopsharryreps2023-03-041-3/+3
| | | | | | | Replacing continue in loops to goto done so that index of packet buffer increases. Signed-off-by: harryreps <harryreps@gmail.com>
* Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-1731-551/+30
|\ | | | | *: convert to SPDX License identifiers
| * *: auto-convert to SPDX License IDsDavid Lamparter2023-02-0930-532/+30
| | | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: sort out & explain licenses used in FRRDavid Lamparter2023-02-091-19/+0
| | | | | | | | | | | | | | New "introduction" note in `COPYING`, and all the licenses moved into `doc/licenses/`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #12802 from sri-mohan1/sri-bableDonald Sharp2023-02-154-15/+17
|\ \ | | | | | | babeld: changes for code maintainability
| * | babeld: changes for code maintainabilitysri-mohan12023-02-144-15/+17
| | | | | | | | | | | | | | | | | | These changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | | Merge pull request #12762 from sri-mohan1/sri-bableDonald Sharp2023-02-101-12/+14
|\| | | |/ |/| babeld: changes for code maintainability
| * babeld: changes for code maintainabilitysri-mohan12023-02-071-12/+14
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | babeld: Fix filtering against all interfacesYuxiang Zhu2023-02-061-2/+5
|/ | | | | | | 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>
* babeld: During intf startup, ignore address already in useDonald Sharp2023-01-281-9/+9
| | | | | | | | | | | | | | When listening on a multicast group. No need to actually fail the operation when it's already being used. Let's not treat the Address already in use error message as one that is stopping everything from working. Especially since multiple interface events cause this to happen. Without this, if config is read in before full connection to zebra, babel will never establish neighbors. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* babeld: The function is already a pointerDonald Sharp2023-01-281-1/+1
| | | | | | Don't send the address of in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>