summaryrefslogtreecommitdiffstats
path: root/ldpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ldpd: Stop and free synchronous Zebra client on destroyDonatas Abraitis2023-06-272-1/+8
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* ldpd: changes for code maintainabilitysri-mohan12023-06-145-34/+17
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-06-061-41/+32
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-06-051-51/+40
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-06-052-37/+20
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-06-011-39/+33
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-05-231-54/+49
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-05-091-42/+27
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-05-083-44/+29
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-05-071-137/+99
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-05-061-39/+20
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: changes for code maintainabilitysri-mohan12023-05-051-40/+30
| | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* Merge pull request #13113 from sri-mohan1/sri-mohan-ldpDonatas Abraitis2023-03-281-22/+15
|\ | | | | ldpd: changes for code maintainability
| * ldpd: changes for code maintainabilitysri-mohan12023-03-271-22/+15
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | *: Convert event.h to frrevent.hDonald Sharp2023-03-241-1/+1
| | | | | | | | | | | | | | 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-244-8/+8
| | | | | | | | | | | | Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp2023-03-2410-73/+73
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert struct thread_master to struct event_master and it's ilkDonald Sharp2023-03-244-9/+8
| | | | | | | | | | | | | | Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp2023-03-243-3/+3
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_fetch and thread_call to event_fetch and event_callDonald Sharp2023-03-242-4/+4
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-2410-60/+58
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Rename `struct thread` to `struct event`Donald Sharp2023-03-2413-87/+87
| | | | | | | | | | | | | | | | | | 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-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #12920 from sri-mohan1/sri-mohan-ldpmobash-rasool2023-03-012-12/+12
|\| | | | | ldpd: changes for code maintainability
| * ldpd: changes for code maintainabilitysri-mohan12023-03-012-12/+12
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | Merge pull request #12863 from sri-mohan1/sri-mohan-ldpDonald Sharp2023-02-221-127/+103
|\| | | | | ldpd: changes for code maintainability
| * ldpd: changes for code maintainabilitysri-mohan12023-02-221-127/+103
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | Merge pull request #12851 from sri-mohan1/sri-mohan-ldpRuss White2023-02-211-53/+97
|\| | | | | ldpd: changes for code maintainability
| * ldpd: changes for code maintainabilitysri-mohan12023-02-201-53/+97
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | Merge pull request #12845 from sri-mohan1/sri-mohan-ldpDonatas Abraitis2023-02-191-10/+15
|\| | | | | ldpd: changes for code maintainability
| * ldpd: changes for code maintainabilitysri-mohan12023-02-191-10/+15
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | *: auto-convert to SPDX License IDsDavid Lamparter2023-02-0938-483/+38
| | | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #12707 from donaldsharp/missed_enumsDonatas Abraitis2023-02-074-21/+19
|\ \ | |/ |/| Missed enums
| * ldpd: Add missing enum's to switch statementDonald Sharp2023-01-314-21/+19
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecationDonald Sharp2023-02-011-4/+0
|\ \ | |/ |/| *: Drop deprecated incorrect JSON fields with wrong naming
| * *: Drop deprecated incorrect JSON fields with wrong namingDonatas Abraitis2023-01-311-4/+0
| | | | | | | | | | | | Deprecation cycle already passed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | *: no-warn pragmas for non-const format stringsDavid Lamparter2023-01-271-0/+4
|/ | | | | | | | We do use non-constant/literal format strings in a few places for more or less valid reasons; put `ignored "-Wformat-nonliteral"` around those so we can have the warning enabled for everywhere else. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ldpd: fix time truncationRafael Zalamena2023-01-201-4/+10
| | | | | | | | Use bigger storage for handling time variables so we don't truncate. Found by Coverity Scan (CID 1519735) Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* ldpd: Clean up use after free in shutdownDonald Sharp2022-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Config data was being freed just prior to it being used for cleanup in shutdown. Prevent this from happening. ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-================================================================= ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142:==2274142==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d00000c880 at pc 0x0000004d94d1 bp 0x7ffd46637810 sp 0 x7ffd46637808 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-READ of size 4 at 0x61d00000c880 thread T0 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #0 0x4d94d0 in ldp_rtr_id_get /home/sharpd/frr8/ldpd/ldpd.c:983:20 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #1 0x56ff92 in gen_ldp_hdr /home/sharpd/frr8/ldpd/packet.c:47:19 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #2 0x56a4b0 in send_notification_full /home/sharpd/frr8/ldpd/notification.c:49:9 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #3 0x56c4b3 in send_notification /home/sharpd/frr8/ldpd/notification.c:117:2 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #4 0x573fb7 in session_shutdown /home/sharpd/frr8/ldpd/packet.c:666:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #5 0x4e2ef1 in adj_del /home/sharpd/frr8/ldpd/adjacency.c:145:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #6 0x55d425 in ldpe_shutdown /home/sharpd/frr8/ldpd/ldpe.c:231:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #7 0x55a9a0 in ldpe_dispatch_main /home/sharpd/frr8/ldpd/ldpe.c:631:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #8 0x7f0c00c035e6 in thread_call /home/sharpd/frr8/lib/thread.c:2006:2 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #9 0x5586f2 in ldpe /home/sharpd/frr8/ldpd/ldpe.c:138:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #10 0x4d46d2 in main /home/sharpd/frr8/ldpd/ldpd.c:339:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #11 0x7f0c00476d09 in __libc_start_main csu/../csu/libc-start.c:308:16 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #12 0x429cb9 in _start (/usr/lib/frr/ldpd+0x429cb9) ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-0x61d00000c880 is located 0 bytes inside of 2008-byte region [0x61d00000c880,0x61d00000d058) ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-freed by thread T0 here: ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #0 0x4a3aad in free (/usr/lib/frr/ldpd+0x4a3aad) ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #1 0x4de6c8 in config_clear /home/sharpd/frr8/ldpd/ldpd.c:2001:2 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #2 0x55d12d in ldpe_shutdown /home/sharpd/frr8/ldpd/ldpe.c:211:2 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #3 0x55a9a0 in ldpe_dispatch_main /home/sharpd/frr8/ldpd/ldpe.c:631:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #4 0x7f0c00c035e6 in thread_call /home/sharpd/frr8/lib/thread.c:2006:2 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #5 0x5586f2 in ldpe /home/sharpd/frr8/ldpd/ldpe.c:138:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #6 0x4d46d2 in main /home/sharpd/frr8/ldpd/ldpd.c:339:3 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #7 0x7f0c00476d09 in __libc_start_main csu/../csu/libc-start.c:308:16 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142-previously allocated by thread T0 here: ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #0 0x4a3ea2 in calloc (/usr/lib/frr/ldpd+0x4a3ea2) ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #1 0x4d6146 in config_new_empty /home/sharpd/frr8/ldpd/ldpd.c:1967:10 ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #2 0x558678 in ldpe /home/sharpd/frr8/ldpd/ldpe.c:134:11 -- ./isis_rlfa_topo1.test_isis_rlfa_topo1/rt8.ldpd.asan.2274142- #4 0x7f0c00476d09 in __libc_start_main csu/../csu/libc-start.c:308:16 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #12196 from opensourcerouting/xref-vtyshDonald Sharp2022-11-032-3/+0
|\ | | | | *: rewrite `extract.pl` using `xref` infra
| * build, vtysh: extract vtysh commands from .xrefDavid Lamparter2022-10-262-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ldpd: Make ldpd happy with clang-16Donald Sharp2022-10-261-2/+1
|/ | | | Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
* Merge pull request #12066 from opensourcerouting/cleanup-cli-xrefDonald Sharp2022-10-131-1/+1
|\ | | | | *: clean up various CLI-related bits
| * *: fix some malformed CLI docstringsDavid Lamparter2022-10-061-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: Create and use infrastructure to show debugs in libDonald Sharp2022-10-071-1/+5
|/ | | | | | | | | 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>
* ldpd: changes for code maintainabilitysri-mohan12022-08-301-6/+6
| | | | | | these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* ldpd: Convert thread_cancel to THREAD_OFFDonald Sharp2022-07-2110-43/+43
| | | | | | Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd, ldpd: No need for an explicit NULL check for thread_timer_remain_secondDonatas Abraitis2022-07-183-12/+4
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* ldpd: Check if the thread is scheduled before calling for remained timeDonatas Abraitis2022-07-181-1/+3
| | | | | | | | | | | | | | | | | | | LDPD crashes when hold time is configured to 65535: (gdb) bt 0 0x00007f8c3fc224bb in raise () from /lib64/libpthread.so.0 1 0x00007f8c4138a3dd in core_handler () from /lib64/libfrr.so.0 2 <signal handler called> 3 0x00007f8c3fc1ccc0 in pthread_mutex_lock () from /lib64/libpthread.so.0 4 0x00007f8c4139914b in thread_timer_remain_msec () from /lib64/libfrr.so.0 5 0x00007f8c41399209 in thread_timer_remain_second () from /lib64/libfrr.so.0 6 0x000000000040eb19 in adj_to_ctl () 7 0x0000000000427b38 in ldpe_nbr_ctl () 8 0x000000000042fd68 in control_dispatch_imsg () 9 0x00007f8c4139a628 in thread_call () from /lib64/libfrr.so.0 10 0x00000000004265fc in ldpe () 11 0x000000000040a68f in main () Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* *: use FRR interface name definition everywhereRafael Zalamena2022-05-021-11/+11
| | | | | | | Don't rely on the OS interface name length definition and use the FRR definition instead. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>