summaryrefslogtreecommitdiff
path: root/sharpd
AgeCommit message (Collapse)Author
2024-11-17Merge pull request #17445 from cscarpitta/fix/sharp-use-ipv6-max-bitlenDonatas Abraitis
sharpd: Convert numeric 128 into IPV6_MAX_BITLEN for prefixlen
2024-11-17sharpd: Use IPV6_MAX_BITLEN in `sharp send opaque notify`Carmine Scarpitta
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-17sharpd: Use IPV6_MAX_BITLEN in `sharp install seg6local-routes`Carmine Scarpitta
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-17sharpd: Fix typo in `sharp install seg6local-routes` help messageCarmine Scarpitta
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-17sharpd: Fix typo in `sharp install seg6-routes` help messageCarmine Scarpitta
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-17sharpd: Fix typo in `sharp install routes` help messageCarmine Scarpitta
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-10-28sharpd: Allow sharpd to watch nexthops in the mribDonald Sharp
Nothing special here, just allow sharpd to ask to watch nexthops in the mrib. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08sharpd: Eliminate leaked list for locator-chunksDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-04sharpd: fix set ZAPI_MESSAGE_NEXTHOP in nhg only when nexthops usedPhilippe Guibert
The ZAPI_MESSAGE_NEXTHOP flag is systematically set, even if the route message does not include any nexthops. Limit the usage of this value only when nexthops are present. Fixes: 8a71d93d85a6 ("sharpd: Add Super Happy Advanced Routing Protocol") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-25zebra, sharpd: add srv6 End.DX6 supportPhilippe Guibert
Add the support for adding DX6 behavior into netlink layer of zebra. Add the necessary test in sharpd. > ubuntu2204# sharp install seg6local-routes 1:1::1:2 nexthop-seg6local loop1 End_DX6 4:4::4:6 1 > ubuntu2204# do show ipv6 route > [..] > D>* 1:1::1:2/128 [150/0] is directly connected, loop1, seg6local End.DX6 nh6 4:4::4:6, weight 1, 00:00:03 Signed-off-by: Philippe Guibert <philippe.guibert@6wind.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-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-26sharpd: Add ability to turn off watching of redistributionDonald Sharp
Wanted to do some testing of redistribute without having to restart sharpd over and over. Added ability to turn off the `sharp watch redistribute XX` functionality. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-23sharpd: Fix coverity issuesDonald Sharp
New commits had an assignment instead of a comparison option. Coverity wisely found it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-22sharpd: Allow sharpd to listen to neighbor eventsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-09Merge pull request #15001 from pguibert6WIND/zebra_nexthop_reworkRuss White
Zebra nexthop rework
2024-01-04lib, sharpd: Move sys/resource.h to where it is usedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-18bgpd, lib: add zapi_route_set_nhg_id() supportPhilippe Guibert
There is no function that both sets the nhg id, and sets the ZAPI_MESSAGE_NHG flag if the nhg id is valid. Create a ZAPI API to do this, and apply the changes wherever needed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-12-05sharpd: fix avoid twice sending NHG_DEL for a nexthop-groupPhilippe Guibert
After removing the nexthop of a nexthop group, when the nexthop group is removed, a nhg removal failure happens: > ubuntu2204(config)# nexthop-group CCC > ubuntu2204(config-nh-group)# nexthop 192.0.2.211 loop1 > ubuntu2204(config-nh-group)# no nexthop 192.0.2.211 loop1 > [..] > 2023/12/05 08:59:22 SHARP: [H3QKG-WH8ZV] Removed nhg 179687505 > ubuntu2204(config-nh-group)# exi > ubuntu2204(config)# no nexthop-group CCC > [..] > 2023/12/05 08:59:27 SHARP: [N030J-V0SFN] Failed removal of nhg 179687505 The NHG_DEL message is sent twice at the nexthop deletion, and at the nexthop-group deletion. Avoid sending it twice. Fixes: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-12-05sharpd: fix deleting nhid when suppressing nexthop from nh groupPhilippe Guibert
When no nexthops are in a nexthop group, two successive events are sent: NHG_DEL and NHG_ADD, but only the NHG_DEL one is necessary. Fixes this by returning in the nhg_add() function. Fixes: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-11-30sharpd: fix deleting nhid when suppressing nexthop from nh groupPhilippe Guibert
When removing the last nexthop from a nexthop-group, the nexthop group remains in the zebra contexts: > ubuntu2204(config)# nexthop-group gdgd > 2023/11/23 14:06:36 SHARP: [Q5NBA-GN1BG] NHG ID assigned: 179687502 > ubuntu2204(config-nh-group)# nexthop 192.0.2.7 loop1 > ubuntu2204(config-nh-group)# 2023/11/23 14:06:38 ZEBRA: [VNMVB-91G3G] _netlink_nexthop_build_group: ID (179687502): group 338 > 2023/11/23 14:06:38 ZEBRA: [R43C6-KYHWT] netlink_nexthop_msg_encode: RTM_NEWNEXTHOP, id=179687502 > 2023/11/23 14:06:38 ZEBRA: [HYEHE-CQZ9G] nl_batch_send: netlink-dp (NS 0), batch size=44, msg cnt=1 > 2023/11/23 14:06:38 SHARP: [JWRCN-N9K90] Installed nhg 179687502 > > ubuntu2204(config-nh-group)# no nexthop 192.0.2.7 loop1 > 2023/11/23 14:06:47 SHARP: [Y2G2F-ZTW6M] nhg_add: nhg 179687502 not sent: no valid nexthops > ubuntu2204(config-nh-group)# do show nexthop-group rib 179687502 > ID: 179687502 (sharp) > RefCnt: 1 > Uptime: 00:00:23 > VRF: default > Valid, Installed > Depends: (338) > via 192.0.2.7, loop1 (vrf default), weight 1 Fix this by sending an NHG_DEL message when no nexthops are attached, and when the id was already installed. Fixes: 5a9c0931aa95 ("sharpd: don't send invalid nexthop-groups to zebra") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-11-23sharpd: replace `receive_notify` with requestDavid Lamparter
Send `ZEBRA_ROUTE_NOTIFY_REQUEST` rather than relying on the options field in zclient startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-20sharpd: use `zclient->nexthop_update`David Lamparter
Same as above. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-15sharpd: Set Callback Function for Memory CleanupKeelan10
Implement a callback function for memory cleanup of sharp_nh_tracker. Specifically, set `sharp_nh_tracker_free` as the deletion function for the `sg.nhs` list. This ensures proper cleanup of resources when elements are removed. The ASan leak log for reference: ``` *********************************************************************************** Address Sanitizer Error detected in zebra_nht_resolution.test_verify_nh_resolution/r1.asan.sharpd.32320 ================================================================= ==32320==ERROR: LeakSanitizer: detected memory leaks Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x7f4ee812ad28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x7f4ee7b291cc in qcalloc lib/memory.c:105 #2 0x5582be672011 in sharp_nh_tracker_get sharpd/sharp_nht.c:36 #3 0x5582be680b42 in watch_nexthop_v4_magic sharpd/sharp_vty.c:139 #4 0x5582be680b42 in watch_nexthop_v4 sharpd/sharp_vty_clippy.c:192 #5 0x7f4ee7aac0b1 in cmd_execute_command_real lib/command.c:978 #6 0x7f4ee7aac575 in cmd_execute_command lib/command.c:1036 #7 0x7f4ee7aac9f4 in cmd_execute lib/command.c:1203 #8 0x7f4ee7bd50bb in vty_command lib/vty.c:594 #9 0x7f4ee7bd5566 in vty_execute lib/vty.c:1357 #10 0x7f4ee7bdde37 in vtysh_read lib/vty.c:2365 #11 0x7f4ee7bc8dfa in event_call lib/event.c:1965 #12 0x7f4ee7b0c3bf in frr_run lib/libfrr.c:1214 #13 0x5582be671252 in main sharpd/sharp_main.c:188 #14 0x7f4ee6f1bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s). *********************************************************************************** ``` Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-11-13sharpd: Clean up memory leaks on shutdownDonald Sharp
a) The cleanup of zclient on shutdown was not being done b) Cleanup vrf shutdown c) Cleanup some lists Signed-off-by: Donald Sharp <sharpd@nvidia.com> sharpd: Cleanup shutdown of vrf and some lists 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-09-29*: Do not cast to the same type as the destination isDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-20bgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthopDmytro Shytyi
Append zebra and lib to use muliple SRv6 segs SIDs, and keep one seg SID for bgpd and sharpd. Note: bgpd and sharpd compilation relies on the lib and zebra files, i.e if we separate this: lib or zebra or bgpd or sharpd in different commits - this will not compile. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-07-10sharpd: allow sharpd to install non-recursive routesMark Stapp
Add a config option so that sharpd can install routes without the ALLOW_RECURSION flag, matching IGP behavior. The default remains 'recursion'. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-06-23sharpd: support opaque zapi notificationsMark Stapp
Add cli and support to sharpd to exercise the zapi opaque 'notification' features. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-20Merge pull request #12933 from Orange-OpenSource/link_statePhilippe Guibert
lib: Update edge key in link state database
2023-04-07sharpd: Update TE to new Link State Edge keyOlivier Dugeon
Following the modification of the edge key in link state database this patch updates the sharp_vty.c file to replace the old uint64_t edge key by the new ls_edge_key structure when searching for an edge. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-06*: Use a `struct prefix *p` instead of a `struct prefix` in functionsDonald Sharp
When passing a prefix into a function let's pass by address instead of pass by value. Let's save our stack space. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-03sharpd: Fix sharpd memory leakKeelan10
Free path Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-03-30sharpd: Adjust TED builderOlivier Dugeon
Following correction of IS-IS subnet creation, this patch adjust the way the TED is created in sharpd to automatically adjust subnet deletion. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.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 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_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-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-13sharpd: clang-format style fixStephen Worley
clang-format style fix Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13lib,sharpd: add ability for sharpd to install vni labelsStephen Worley
Add the ability for sharpd to install vni labels for testing. This patch is just for testing/dev work purposes with evpn. It adds some code to vty for nexthop-groups so we can explicitly add a label to nexthops and then let sharpd encode them to zebra. Signed-off-by: Stephen Worley <sworley@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>
2022-11-22sharpd: traffic control PoCSiger Yang
This commit adds a command to sharpd to validate the proof of concept for traffic control on specific interface with specific filters. Signed-off-by: Siger Yang <siger.yang@outlook.com>
2022-11-04*: Add ability to encode / decode resilence down zapiDonald Sharp
At this point add abilty for the encode/decode of the resilience down ZAPI to zebra. Just hookup sharpd at this point in time. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-04*: Add ability for daemons to notice resilience changesDonald Sharp
This patch just introduces the callback mechanism for the resilient nexthop changes so that upper level daemons can take advantage of the change. This does nothing at this point but just call some code. 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-18sharpd: add support for SRv6 End.DT46 behaviorCarmine Scarpitta
This commit adds the support for SRv6 End.DT46 behavior to SHARPD. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>