summaryrefslogtreecommitdiff
path: root/ripd
AgeCommit message (Collapse)Author
2023-05-25ripd: embed BFD YANG modelsDavid Lamparter
The frr-ripd model has a dependency on frr-bfdd, so include it in build. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-05-23Merge pull request #13548 from ↵Russ White
opensourcerouting/fix/use_min_value_of_cli_zebra_cap_ecmp ripd: Make sure we do not overuse higher values for ECMP count
2023-05-23ripd: Use argv_find to avoid buffer overflow when parsing allow-ecmp argsDonatas Abraitis
==13211==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000af158 at pc 0x55d48c5f1e38 bp 0x7fffd8a713d0 sp 0x7fffd8a713c0 READ of size 8 at 0x6020000af158 thread T0 #0 0x55d48c5f1e37 in rip_allow_ecmp ripd/rip_cli.c:98 #1 0x7f2ec125aa0f in cmd_execute_command_real lib/command.c:990 #2 0x7f2ec125ae90 in cmd_execute_command lib/command.c:1049 #3 0x7f2ec125b406 in cmd_execute lib/command.c:1217 #4 0x7f2ec137ca36 in vty_command lib/vty.c:551 #5 0x7f2ec137ce52 in vty_execute lib/vty.c:1314 #6 0x7f2ec1384f9e in vtysh_read lib/vty.c:2223 #7 0x7f2ec137041b in event_call lib/event.c:1995 #8 0x7f2ec12b54bf in frr_run lib/libfrr.c:1204 #9 0x55d48c5f0f32 in main ripd/rip_main.c:171 #10 0x7f2ec0ad9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #11 0x55d48c5f1349 in _start (/usr/lib/frr/ripd+0x3b349) 0x6020000af158 is located 0 bytes to the right of 8-byte region [0x6020000af150,0x6020000af158) allocated by thread T0 here: #0 0x7f2ec18ccb40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40) #1 0x7f2ec12d2e41 in qmalloc lib/memory.c:100 #2 0x7f2ec125a815 in cmd_execute_command_real lib/command.c:955 #3 0x7f2ec125ae90 in cmd_execute_command lib/command.c:1049 #4 0x7f2ec125b406 in cmd_execute lib/command.c:1217 #5 0x7f2ec137ca36 in vty_command lib/vty.c:551 #6 0x7f2ec137ce52 in vty_execute lib/vty.c:1314 #7 0x7f2ec1384f9e in vtysh_read lib/vty.c:2223 #8 0x7f2ec137041b in event_call lib/event.c:1995 #9 0x7f2ec12b54bf in frr_run lib/libfrr.c:1204 #10 0x55d48c5f0f32 in main ripd/rip_main.c:171 #11 0x7f2ec0ad9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: heap-buffer-overflow ripd/rip_cli.c:98 in rip_allow_ecmp Shadow bytes around the buggy address: 0x0c048000ddd0: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fa 0x0c048000dde0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fd 0x0c048000ddf0: fa fa fd fa fa fa fd fd fa fa fd fd fa fa fd fd 0x0c048000de00: fa fa fd fa fa fa fd fd fa fa 00 03 fa fa fd fa 0x0c048000de10: fa fa fd fa fa fa 00 00 fa fa fd fa fa fa 00 03 =>0x0c048000de20: fa fa 00 03 fa fa fd fa fa fa 00[fa]fa fa fa fa 0x0c048000de30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c048000de40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c048000de50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c048000de60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c048000de70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==13211==ABORTING Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-18ripd: Make sure we do not overuse higher values for ECMP countDonatas Abraitis
Use a minimum value of a CLI version and a value of Zebra capabilities. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-11Merge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limitDonald Sharp
ripd: Implement allow-ecmp X command
2023-05-08ripd: fix another memtype mismatchRenato Westphal
Fixes #13447. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-05ripd: Do not overrun with more ECMP paths than Zebra supportsDonatas Abraitis
Let's say FRR is compiled with ECMP max 16, we enter `allow-ecmp 10`, but Zebra supports only 4. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04ripd: Implement `allow-ecmp X` commandDonatas Abraitis
Allow setting an arbitrary number of paths to be installed instead of ALL. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-03ripd: use correct memory type when freeing BFD profileRenato Westphal
Fixes #13415. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-03ripd: fix null-pointer dereferenceRenato Westphal
Fixes #13416. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-02Merge pull request #13366 from zmw12306/rte_tagDonatas Abraitis
ripd: add non-zero check for RIPv1 reserved field
2023-04-25ripd: add non-zero check for RIPv1 reserved field,zmw12306
According to RFC2453 3.6, the tag of a RIP-1 entry should be zero Signed-off-by: zmw12306 <zmw12306@gmail.com>
2023-04-25Merge pull request #13246 from opensourcerouting/rip-bfdRuss White
ripd: support BFD integration
2023-04-25Merge pull request #13326 from ↵Russ White
opensourcerouting/feature/rip_topotest_distribute_list ripd: Create non default passive interface if defined so
2023-04-19ripd: support BFD integrationRenato Westphal
Implement RIP peer monitoring with BFD. RFC 5882 Generic Application of Bidirectional Forwarding Detection (BFD), Section 10.3 Interactions with RIP. Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-04-18ripd: Align show ip rip status output for sourcesDonatas Abraitis
Before: ``` Routing Protocol is "rip" Sending updates every 5 seconds with +/-50%, next due in 0 seconds Timeout after 15 seconds, garbage collect after 10 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive any version Interface Send Recv Key-chain r1-eth0 2 1 2 Routing for Networks: 192.168.1.0/24 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 192.168.1.2 0 0 120 00:00:05 192.168.1.3 0 0 120 00:00:04 Distance: (default is 120) ``` After: ``` Routing Protocol is "rip" Sending updates every 5 seconds with +/-50%, next due in 4 seconds Timeout after 15 seconds, garbage collect after 10 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive any version Interface Send Recv Key-chain r1-eth0 2 1 2 Routing for Networks: 192.168.1.0/24 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 192.168.1.2 0 0 120 00:00:00 192.168.1.3 0 0 120 00:00:04 Distance: (default is 120) ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-18ripd: Create non default passive interface if defined soDonatas Abraitis
Without this patch, it's never get non-passive and even listed under status: Configuration: ``` router rip network 192.168.1.0/24 network 10.10.10.1/32 passive-interface default no passive-interface r2-eth0 timers basic 5 15 10 exit ``` ``` r2# do sh ip rip status Routing Protocol is "rip" Sending updates every 5 seconds with +/-50%, next due in 4 seconds Timeout after 15 seconds, garbage collect after 10 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive any version Interface Send Recv Key-chain lo 2 1 2 r2-eth0 2 1 2 Routing for Networks: 10.10.10.1/32 192.168.1.0/24 Passive Interface(s): lo r2-eth0 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 192.168.1.3 0 0 120 00:00:04 Distance: (default is 120) r2# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-12lib: convert if_rmap config output to northboundIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-04-11ripd: adapt to new YANG NB if_rmap conversionChristian Hopps
- uses YANG grouping and calls if_rmap library code to implement. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-11Merge pull request #13245 from anlancs/cleanup/ripd-1Donatas Abraitis
ripd: Cosmetic changes for ripd
2023-04-10ripd: Simplify code for distanceanlan_cs
Simplify the code for `rip_distance_apply()`. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-10ripd: Correct one debug loganlan_cs
Correct one debug log, which wrongly mixed address and port. Before: ``` ripd[469497]: [NDAGH-Z85V7] rip_send_packet 3.3.3.4 > 224.0.0.9 (enp1s0) ripd[469497]: [VEJY5-67P5X] SEND to 224.0.0.9520 ``` After: ``` ripd[471330]: [NDAGH-Z85V7] rip_send_packet 3.3.3.4 > 224.0.0.9 (enp1s0) ripd[471330]: [T8DFR-P09JH] SEND to 224.0.0.9 port 520 ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-07ripd: implement new YANG operational stateChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07ripd: yang: extend nexthops functionality in YANG model - skeletonChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-24*: Fixup formatting issues due to reorderingDonald Sharp
All the event changes exposed a bunch of places where we were not properly following our standards. Just clean them up in one big fell swoop. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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 THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
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_timer_remain_XXX to event_timer_remain_XXXDonald Sharp
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-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-01-31ripd: Add missin enum's to switch statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.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-12ripd: Cleanup memory allocations on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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>
2022-09-04Merge pull request #11898 from sri-mohan1/sri-rip-dbg1Donatas Abraitis
ripd: changes for code maintainability
2022-09-03ripd: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-24ripd: Use a sequence number instead of timeDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21ripd: Convert thread_cancel to THREAD_OFFDonald Sharp
Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21ripd: Remove various macros that overlap THREAD_OFFDonald Sharp
Let's just use THREAD_OFF consistently in the code base instead of each daemon having a special macro that needs to be looked at and remembered what it does. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-13*: Use autocomplete for route-maps under commands that require itDonatas Abraitis
For example: ``` donatas-laptop# show bgp ipv4 unicast neighbors 127.0.0.2 advertised-routes route-map ? RMAP_NAME Name of the route map testas2 testas donatas-laptop(config)# router bgp donatas-laptop(config-router)# address-family ipv4 donatas-laptop(config-router-af)# redistribute connected route-map ? RMAP_NAME Pointer to route-map entries testas2 testas donatas-laptop(config-router-af)# network 192.168.0.0/23 route-map ? RMAP_NAME Name of the route map testas2 testas ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11ripd: Use correct usage of memcpy() when zeroing structDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-19*: Fix spelling of modifedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19*: Fix spelling of strucutreDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02*: Fix spelling of IntefaceDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02*: Fix spelling of ojbectDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>