summaryrefslogtreecommitdiff
path: root/ripd
AgeCommit message (Collapse)Author
2025-01-14lib: northbound/mgmtd: add backend model supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-11-25ripd: Use route_node_match instead of route_node_match_ipv4Donald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08ripd: fix show run output for distribute-listIgor Ryzhov
CLI show callbacks should be defined in frr_ripd_cli_info instead of frr_ripd_info, because only the former is loaded by mgmtd and only its callbacks are getting called for config output. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-07-05ripd: adjust header for display commandanlan_cs
Continue to adjust `show ip rip` 's header for display comand. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2024-06-27ripd: Change the start value of sequence 1 to 0T-Nicolas
Signed-off-by: T-Nicolas <github@toselli.email>
2024-05-10*: Modify agentx to be allowed to be calledDonald Sharp
If you had a situation where an operator turned on ospfd with snmp but not ospf6d and agentx was configured then you get into a situation where ospf6d would complain that the config for agentx did not exist. Let's modify the code to allow this situation to happen. Fixes: #15896 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-22ripd: convert RPC commands to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22lib: rework northbound RPC callbackIgor Ryzhov
Change input/output arguments of the RPC callback from lists of (xpath/value) tuples to YANG data trees. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-09ripd: fix "clear ip rip" commandIgor Ryzhov
mgmtd doesn't support YANG RPCs yet, so this command must go directly to ripd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-08Merge pull request #15469 from LabNConsulting/chopps/keychain-yangDonald Sharp
add ietf-key-chain YANG module support
2024-03-06ripd: fix missing "exit" for "router rip"Igor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-04lib: add keychain northbound supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
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-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-26ripngd: convert ripngd to mgmtdChristian Hopps
- a couple small fixes for ripd conversion as well. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26ripd: ripd convert to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-24Merge pull request #15196 from idryzhov/nb-leaf-listDonald Sharp
lib: remove leaf-list xpath hack from northbound
2024-01-23lib: remove leaf-list xpath hack from northboundIgor Ryzhov
Currently, when editing a leaf-list, `nb_candidate_edit` expects to receive it's xpath without a predicate and the value in a separate argument, and then creates the full xpath. This hack is complicated, because it depends on the operation and on the caller being a backend or not. Instead, let's require to always include the predicate in a leaf-list xpath. Update all the usages in the code accordingly. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22ripd: 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-22ripd: use new distribute-list northbound code.Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22lib: enable multiple instance support with distribute listsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-04*: Remove Crypto openSSL define from zebra.hDonald Sharp
Only a couple of places use this. Move these to a better spot. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-29lib: all: remove './' from xpath 22% speedupChristian Hopps
fixes #8299 Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-28Merge pull request #14811 from donaldsharp/zebra_final_shutdown_finallyChristian Hopps
Zebra final shutdown finally
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*: Cleanup keychain on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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-13ripd: Cleanup memory on shutdownDonald Sharp
a) routemap data was not being cleaned up b) rip data structure was not being cleaned up Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-07*: Move distance related defines into their own headerDonald 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-10-07*: remove ZEBRA_INTERFACE_VRF_UPDATEanlan_cs
Currently when one interface changes its VRF, zebra will send these messages to all daemons in *order*: 1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF ) 2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF ) 3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF ) When daemons deal with `VRF_UPDATE`, they use `zebra_interface_vrf_update_read()->if_lookup_by_name()` to check the interface exist or not in old VRF. This check will always return *NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't find this interface in old VRF. Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough, they will deal with RB tree, so don't send this `VRF_UPDATE` message when vrf changes. Since all daemons have good mechanism to deal with changing vrf, and don't use this `VRF_UPDATE` mechanism. So, it is safe to completely remove all the code with `VRF_UPDATE`. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-06-15Revert "ripd: Cleanup memory allocations on shutdown"Igor Ryzhov
This reverts commit 3d1588d8ed537e3dbf120e1b2a5ad5b3c00c7897. This commit introduced a crash. When the VRF is deleted, the RIP instance should not be freed, because the NB infrastructure still stores the pointer to it. The instance should be deleted only when it's actually deleted from the configuration. To reproduce the crash: ``` frr# conf t frr(config)# vrf vrf1 frr(config-vrf)# exit frr(config)# router rip vrf vrf1 frr(config-router)# exit frr(config)# no vrf vrf1 frr(config)# no router rip vrf vrf1 vtysh: error reading from ripd: Resource temporarily unavailable (11)Warning: closing connection to ripd because of an I/O error! frr(config)# ``` Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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>