summaryrefslogtreecommitdiff
path: root/babeld
AgeCommit message (Collapse)Author
2024-09-23babeld: 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> (cherry picked from commit 63e2c092a363bf6ff8ca434d1f68bc29fa5b4dac)
2024-09-23babeld: 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> (cherry picked from commit b4c88abe9f61ff8e1402804a47ea74b8580aded2)
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>
2023-01-28babeld: During intf startup, ignore address already in useDonald Sharp
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>
2023-01-28babeld: The function is already a pointerDonald Sharp
Don't send the address of in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-24Merge pull request #12640 from vfreex/babel-no-commandsRuss White
babeld: Add missing `no` commands
2023-01-21babeld: Add missing `no` commandsYuxiang Zhu
Some babeld commands doesn't have the corresponding negative commands defined, so those commands doesn't work with frr-reload.py. This PR adds those missing commands. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2023-01-21babeld: Fix --terminal optionYuxiang Zhu
babeld's `--terminal` option doesn't work because it replaces `stdin` with `/dev/null`. It seems to me this function can be removed as `frr_run` handles that in daemon mode. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-07*: Create and use infrastructure to show debugs in libDonald Sharp
There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>