summaryrefslogtreecommitdiffstats
path: root/staticd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: remove mgmtd exception from xref2vtyshIgor Ryzhov2024-01-281-2/+2
| | | | | | | | | | We may actually need to send CLI commands to mgmtd and another daemon at the same time, for example, if this daemon is not mgmtd-converted. The only daemon this exception protects is staticd. But we don't actually need any configuration commands in staticd, so just remove the exception and don't install unnecessary commands to staticd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: fix `frr_daemon_info` indentationDavid Lamparter2024-01-271-7/+12
| | | | | | | | | | 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>
* ripd: ripd convert to mgmtdChristian Hopps2024-01-262-1/+4
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib, mgmtd: rename ignore_cbs to ignore_cfg_cbsIgor Ryzhov2024-01-111-1/+1
| | | | | | | | Setting this variable to true makes NB ignore only configuration-related callbacks. CLI-related callbacks are still loaded and executed, so rename the variable to make it clearer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* lib: fix the ASAN OneDefinitionRule violation.Christian Hopps2023-12-121-1/+1
| | | | | | Rename global client pointer variables and make the linkage static. Signed-off-by: Christian Hopps <chopps@labn.net>
* Merge pull request #14922 from louis-6wind/fix-bfd-static-sourceRafael Zalamena2023-12-061-0/+12
|\ | | | | staticd: fix changing to source auto in bfd monitor
| * staticd: fix changing to source auto in bfd monitorLouis Scalbert2023-12-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When monitoring a static route with BFD multi-hop, the source IP can be either configured or retrieved from NextHop-Tracking (NHT). After removing a configured source, the source is supposed to be retrieved from NHT but it remains to the previous value. This is problematic if the user desires to fix the configuration of a incorrect source IP. For example, theses two commands results in the incorrect state: > ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop source 10.2.2.2 > ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop When removing the source, BFD is unable to find the source from NHT via bfd_nht_update() were called. Force zebra to resend the information to BFD by unregistering and registering again NHT. The (...)/frr-nexthops/nexthop northbound apply_finish function will trigger a call to static_install_nexthop() that does a call to static_zebra_nht_register(nh, true); Fixes: b7ca809d1c ("lib: BFD automatic source selection") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | lib: all: remove './' from xpath 22% speedupChristian Hopps2023-11-293-77/+77
| | | | | | | | | | | | fixes #8299 Signed-off-by: Christian Hopps <chopps@labn.net>
* | Merge pull request #14838 from idryzhov/mgmtd-cli-outChristian Hopps2023-11-294-62/+76
|\ \ | |/ |/| Output configuration of mgmtd-converted daemons from mgmtd
| * mgmtd, staticd: output staticd configuration from mgmtdIgor Ryzhov2023-11-214-62/+76
| | | | | | | | | | | | | | | | As mgmtd now implements vty for staticd, it's logical to output the configuration from there as well. Fully-converted backend daemons should not handle vty commands at all. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | staticd: replace `receive_notify` with requestDavid Lamparter2023-11-231-3/+2
| | | | | | | | | | | | | | Send `ZEBRA_ROUTE_NOTIFY_REQUEST` rather than relying on the options field in zclient startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #14850 from donaldsharp/IFNAMSIZ_GET_YOUR_SHIT_TOGETHERDonatas Abraitis2023-11-221-2/+2
|\ \ | | | | | | *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ
| * | *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZDonald Sharp2023-11-211-2/+2
| |/ | | | | | | | | | | | | | | 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>
* / staticd: use `zclient->nexthop_update`David Lamparter2023-11-201-25/+17
|/ | | | | | Same as before. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* staticd: fix debug commandsIgor Ryzhov2023-11-171-6/+4
| | | | | | Debug commands should be installed in staticd, not in mgmtd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: Move distance related defines into their own headerDonald Sharp2023-11-071-0/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib: convert if_zapi_callbacks into actual hooksDavid Lamparter2023-11-031-2/+4
| | | | | | | | | ...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>
* isisd: staticd: need to link directly against libyangChristian Hopps2023-10-271-1/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* Revert "lib: register bgp link-state afi/safi"Donald Sharp2023-10-101-1/+0
| | | | This reverts commit 1642a68d60cfade4b2fce72aaef58dea700c65c3.
* staticd: Memory leak of string in staticdDonald Sharp2023-10-041-5/+8
| | | | | | | | XSTRDUP and then calling strsep mangles the pointer returned by XSTRDUP. Keep a copy of the orig and when we are done, free that instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #12649 from louis-6wind/bgp-link-stateRuss White2023-09-261-0/+1
|\ | | | | bgpd: add basic support of BGP Link-State RFC7752
| * lib: register bgp link-state afi/safiLouis Scalbert2023-09-181-0/+1
| | | | | | | | | | | | | | Register BGP Link-State AFI/SAFI values from RFC7752. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | Merge pull request #14089 from dmytroshytyi-6WIND/srv6_multiple_segs_sidsRuss White2023-09-216-111/+443
|\ \ | | | | | | bgpd,doc,lib,sharpd,staticd,yang,zebra: SRv6 multiple segs SIDs
| * | staticd: add vtysh srv6 multiple segs SIDsDmytro Shytyi2023-09-201-111/+169
| | | | | | | | | | | | | | | | | | Append staticd vty with multiple segs SIDs. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
| * | staticd: northbound srv6 hooks for segs stack yang modelDmytro Shytyi2023-09-203-0/+249
| | | | | | | | | | | | | | | | | | Provive hooks for srv6 segs SIDs stack yang model. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
| * | staticd: zebra, modify nexthop to support multiple srv6 segs SIDsDmytro Shytyi2023-09-201-0/+15
| | | | | | | | | | | | | | | | | | Adapt the nexthop from 1 to multiple srv6 seg SIDs Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
| * | staticd: add srv6 static route seg informationDmytro Shytyi2023-09-201-0/+10
| |/ | | | | | | Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
* / staticd: Check against NULL before dereferencing vrfDonatas Abraitis2023-09-201-0/+7
|/ | | | | | | | If VRF is not found by the given name, validate it and return an error. Fixes: 76b2bc97e738 ("staticd: Accept full blackhole typed keywords for ip_route_cmd") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* staticd: Accept full blackhole typed keywords for ip_route_cmdDonatas Abraitis2023-08-252-3/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch we allow entering next-hop interface address as any string. Like, we can type: `ip route 10.10.10.10/32 bla`, but this will create a blackhole route instead of using an interface `bla`. The same is with reject. After the patch: ``` $ vtysh -c 'con' -c 'ip route 10.10.10.100/32 bla' ERROR: SET_CONFIG request failed, Error: nexthop interface name must be (reject, blackhole) $ ip link show dev bla 472: bla: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether fa:45:bd:f1:f8:f0 brd ff:ff:ff:ff:ff:ff $ vtysh -c 'sh run | include ip route' $ vtysh -c 'con' -c 'ip route 10.10.10.100/32 blac' $ vtysh -c 'sh run | include ip route' ip route 10.10.10.100/32 blackhole $ vtysh -c 'con' -c 'no ip route 10.10.10.100/32 blac' $ vtysh -c 'sh run | include ip route' $ vtysh -c 'con' -c 'ip route 10.10.10.100/32 blackhole' $ vtysh -c 'sh run | include ip route' ip route 10.10.10.100/32 blackhole $ vtysh -c 'con' -c 'no ip route 10.10.10.100/32 blackhole' $ vtysh -c 'sh run | include ip route' $ vtysh -c 'con' -c 'ip route 10.10.10.100/32 Null0' $ vtysh -c 'sh run | include ip route' ip route 10.10.10.100/32 Null0 $ vtysh -c 'con' -c 'no ip route 10.10.10.100/32 Null0' $ vtysh -c 'sh run | include ip route' $ ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* staticd: fix comparison of nexthop-vrfIgor Ryzhov2023-08-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | When displaying the configuration, the order of nexthop-vrf is wrong, because the default VRF is not displayed, but still compared as the word "default". Therefore it is placed in the middle of the list instead of always being the first one. Before the fix: ``` ip route 1.1.1.0/24 2.2.2.2 nexthop-vrf ccc ip route 1.1.1.0/24 2.2.2.2 ip route 1.1.1.0/24 2.2.2.2 nexthop-vrf eee ``` After the fix: ``` ip route 1.1.1.0/24 2.2.2.2 ip route 1.1.1.0/24 2.2.2.2 nexthop-vrf ccc ip route 1.1.1.0/24 2.2.2.2 nexthop-vrf eee ``` Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Merge pull request #13838 from ak503/static_bfd_vrfChristian Hopps2023-06-271-1/+4
|\ | | | | staticd: Fix bfd for static route in VRF
| * staticd: Fix bfd for static route in VRFDmitrii Turlupov2023-06-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vrf BELLA ip route 1.1.1.1/32 192.168.1.1 bfd profile test exit-vrf Before patch: # do show bfd peers BFD Peers: peer 192.168.1.1 vrf default After patch: # do show bfd peers BFD Peers: peer 192.168.1.1 vrf BELLA Signed-off-by: Dmitrii Turlupov <turlupov@zts.ru>
* | staticd: remove unused YANG moduleChristian Hopps2023-06-231-1/+0
|/ | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* staticd: staticd no longer loads config filesChristian Hopps2023-06-121-2/+2
| | | | | | We need to ignore SIGHUP rather than reload config now. Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: mgmtd: remove abstraction layer and other cleanupChristian Hopps2023-06-041-53/+3
| | | | | | | | | | | | | | Code is no longer using a global FE "client context", and instead creates client objects, rename the structure and it's uses to reflect this. Remove an obfuscating abstraction layer whose existence was entirely based on using a uintptr_t rather than a pointer to an declared-only struct. Change multi-duty "params" structure into a single duty callbacks one. Remove unsupported API code. Signed-off-by: Christian Hopps <chopps@labn.net>
* staticd: remove connect notify function, not neededChristian Hopps2023-05-281-3/+8
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: msg: refactor common connection code from mgmtdChristian Hopps2023-05-281-2/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: fully implement debug flags for mgmtd and clientsChristian Hopps2023-05-011-0/+3
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: lib: read transitioned daemons split config files in mgmtdChristian Hopps2023-04-021-4/+12
| | | | | | | When daemons transition to mgmtd they should stop reading their split config files, and let mgmtd do that, otherwise things can get out of sync. Signed-off-by: Christian Hopps <chopps@labn.net>
* *: Convert event.h to frrevent.hDonald Sharp2023-03-242-2/+2
| | | | | | | 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-4/+4
| | | | | | Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert struct thread_master to struct event_master and it's ilkDonald Sharp2023-03-244-4/+4
| | | | | | | Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-242-2/+2
| | | | | | | | | | | 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>
* lib: staticd: vtysh: apply frrbot style requirementsChristian Hopps2023-03-221-31/+31
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* staticd: handle `distance` valueChristian Hopps2023-03-221-21/+47
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: Enroll Staticd as a backend client for MGMTDChristian Hopps2023-03-224-29/+89
| | | | | | | | | | | | | | | | | | | This commmit introduces Staticd as a backend client for the MGMTd framework. All the static commands will be diverted to the MGMT daemon and will use the transactional model to make changes to the internal state. Similar mechanism can be used by other daemons to use the MGMT framework in the future. This commit includes the following functionalities in the changeset: 1. Diverts all the staticd (config only) commands to MGMTd. 2. Enrolls staticd as a backend client to use the MGMT framework. 3. Modify the staticd NB config handlers so that they can be compiled into a library and loaded in the MGMTd process context. Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* staticd: Tell bfd that we are shutting downDonald Sharp2023-03-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent a use after free and tell the bfd subsystem we are shutting down in staticd. ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460:==2264460==ERROR: AddressSanitizer: heap-use-after-free on address 0x61f000004698 at pc 0x7f65d1eb11b2 bp 0x7ffdbface490 sp 0x7ffdbface488 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-READ of size 4 at 0x61f000004698 thread T0 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #0 0x7f65d1eb11b1 in zclient_bfd_command lib/bfd.c:307 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #1 0x7f65d1eb20f5 in _bfd_sess_send lib/bfd.c:507 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #2 0x7f65d20510aa in thread_call lib/thread.c:1989 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #3 0x7f65d2051f0a in _thread_execute lib/thread.c:2081 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #4 0x7f65d1eb271b in _bfd_sess_remove lib/bfd.c:544 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #5 0x7f65d1eb278d in bfd_sess_free lib/bfd.c:553 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #6 0x7f65d1eb5400 in bfd_protocol_integration_finish lib/bfd.c:1029 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #7 0x7f65d1f42f77 in hook_call_frr_fini lib/libfrr.c:41 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #8 0x7f65d1f494a1 in frr_fini lib/libfrr.c:1199 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #9 0x563b7abefd76 in sigint staticd/static_main.c:70 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #10 0x7f65d200ef91 in frr_sigevent_process lib/sigevent.c:115 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #11 0x7f65d204fac6 in thread_fetch lib/thread.c:1758 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #12 0x7f65d1f49377 in frr_run lib/libfrr.c:1184 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #13 0x563b7abefed1 in main staticd/static_main.c:160 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #14 0x7f65d1b92d09 in __libc_start_main ../csu/libc-start.c:308 ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- #15 0x563b7abefa99 in _start (/usr/lib/frr/staticd+0x15a99) ./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460- Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: remove some leftover license blurbsDavid Lamparter2023-02-091-3/+0
| | | | | | The regex'ing left some paragraphs that didn't exactly match. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-0917-237/+17
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* staticd: Add missing enum's to switch statementDonald Sharp2023-01-312-3/+7
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>