summaryrefslogtreecommitdiffstats
path: root/bfdd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: move all userdata when changing node xpathIgor Ryzhov2020-09-241-0/+6
| | | | | | The same thing was done for interfaces in commit f7c20aa1f. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* bfdd: fix parameter lengthIgor Ryzhov2020-08-241-2/+2
| | | | | | There is no space reserved for "[source-addr='']". Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* bfdd: Allow it to work when V6 is completely turned offDonald Sharp2020-08-142-12/+36
| | | | | | | Experimental patch to allow us to discuss if we should allow bfdd to work when v6 is turned off in the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bfdd: implement minimum TTLRafael Zalamena2020-08-1210-6/+200
| | | | | | | | Initial BFD protocol implementation had a hard coded value of maximum 5 hops, now we have a configurable hop amount with a safe default of 1 hop. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: simplify and remove duplicated codeRafael Zalamena2020-08-113-55/+37
| | | | | | Move the session configuration application logic to a single function. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: implement passive modeRafael Zalamena2020-08-118-5/+183
| | | | | | | | | | | | | | | | | | The passive mode is briefly described in the RFC 5880 Bidirectional Forwarding Detection (BFD), Section 6.1. Overview: > A system may take either an Active role or a Passive role in session > initialization. A system taking the Active role MUST send BFD > Control packets for a particular session, regardless of whether it > has received any BFD packets for that session. A system taking the > Passive role MUST NOT begin sending BFD packets for a particular > session until it has received a BFD packet for that session, and thus > has learned the remote system's discriminator value. At least one > system MUST take the Active role (possibly both). The role that a > system takes is specific to the application of BFD, and is outside > the scope of this specification. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* *: introduce DEFPY_YANG & friendsRenato Westphal2020-08-031-19/+19
| | | | | | | | | | DEFPY_YANG will allow the CLI to identify which commands are YANG-modeled or not before executing them. This is going to be useful for the upcoming configuration back-off timer work that needs to commit pending configuration changes before executing a command that isn't YANG-modeled. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #6731 from opensourcerouting/style-string-prepDonald Sharp2020-07-165-21/+16
|\ | | | | *: string coding style
| * *: remove PRI[udx](8|16|32)David Lamparter2020-07-143-13/+12
| | | | | | | | | | | | | | | | | | | | | | These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
| * *: un-split strings across linesDavid Lamparter2020-07-143-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
* | bfdd: update detect multiplier on profile changeRafael Zalamena2020-07-131-0/+1
|/ | | | | | Add missing profile update hook for detection multiplier change. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: Use XFREE, clean up SA warning for bfd profilesMark Stapp2020-07-031-1/+2
| | | | | | | Use XFREE instead of raw free, clean up SA warning in bfd profile delete. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* Merge pull request #6437 from opensourcerouting/bfd-profiles-bgpDonald Sharp2020-07-025-7/+51
|\ | | | | bfdd,bgpd: profiles integration support
| * bfdd: don't update peers settings on shutdownRafael Zalamena2020-05-293-1/+10
| | | | | | | | | | | | | | During the shutdown phase don't attempt to apply settings to peers as it is useless and will crash if the peer hash is gone. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
| * bfdd,lib: implement protocol profile selectionRafael Zalamena2020-05-293-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the infrastructure for other protocols daemon (e.g. `bgpd`, `ospfd`, `isisd` etc...) to communicate to BFD daemon which profile they want to use with their peers. It was also added the ability for protocols to change profile while running (no need to remove the registration and then register again). The protocols message building function was rewritten to support multiple arguments through `struct bfd_session_arg`, so we can implement new features without the need of changing function prototypes. The old function was also rewritten to keep compatibility. The profile message part is only available for BFD daemon at the moment. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | Merge pull request #6390 from opensourcerouting/bfd-cp-fixRuss White2020-06-161-12/+51
|\ \ | | | | | | bfdd: tell peer when our control plane is dead
| * | bfdd: tell peer when our control plane is deadRafael Zalamena2020-05-141-12/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify and fix the code that handles session teardown on control plane shutdown (either failure or graceful). - Don't move the `NULL` check inside `free` functions that expect data: it creates harder to understand flows. - Add some new debug messages to aid visualizing session deletions. - Add sanity check error message (if it ever happens). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | | *: add filter northbound supportRafael Zalamena2020-06-051-0/+1
| |/ |/| | | | | | | | | Allow all daemons to work with filter northbound. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: remove profile pointers on removalRafael Zalamena2020-05-201-0/+33
| | | | | | | | | | | | Remove all profile references on removal and free all resources on shutdown. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: implement BFD session configuration profilesRafael Zalamena2020-05-207-7/+737
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow user to pre-configure peers with a profile. If a peer is using a profile any configuration made to the peer will take precedence over the profile configuration. In order to track the peer configuration we have now an extra copy of the peer configuration in `peer_profile` inside `struct bfd_session`. This information will help the profile functions to detect user configurations and avoid overriding what the user configured. This is especially important for peers created via other protocols where the default `shutdown` state is disabled (peers created manually are `shutdown` by default). Profiles can be used before they exist: if no profile exists then it will use the default configuration. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd,lib,vtysh: new command node for BFD profilesRafael Zalamena2020-05-201-0/+34
| | | | | | | | | | | | Add the necessary code to implement the BFD profile command node. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: remove duplicated codeRafael Zalamena2020-05-153-115/+88
|/ | | | | | | Move echo/shutdown toggle code to a function and remove the duplicated logic. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* Merge pull request #6301 from pguibert6WIND/bfd_debug_showRafael Zalamena2020-04-271-3/+6
|\ | | | | bfdd: display debugging status of bfd
| * bfdd: display debugging status of bfdPhilippe Guibert2020-04-271-3/+6
| | | | | | | | | | | | display debugging status of bfd. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | bfdd: fix frr-format false warningDavid Lamparter2020-04-271-4/+5
| | | | | | | | | | | | | | | | Dealing with PRIu64 is unfortunately a bit hacky in the frr-format plugin, as in, it works correctly with snprintfrr, but breaks on plain snprintf. There's no good solution unfortunately :/. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | build: make clippy Makefile rules nicerDavid Lamparter2020-04-271-5/+4
| | | | | | | | | | | | | | These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | build: use VPATH for vtysh_scanDavid Lamparter2020-04-271-2/+2
| | | | | | | | | | | | No need to put $(top_srcdir) everywhere. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: change the signature of the northbound callbacks to be more flexibleRenato Westphal2020-04-233-254/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having a fixed set of parameters for each northbound callback isn't a good idea since it makes it difficult to add new parameters whenever that becomes necessary, as several hundreds or thousands of existing callbacks need to be updated accordingly. To remediate this issue, this commit changes the signature of all northbound callbacks to have a single parameter: a pointer to a 'nb_cb_x_args' structure (where x is different for each type of callback). These structures encapsulate all real parameters (both input and output) the callbacks need to have access to. And adding a new parameter to a given callback is as simple as adding a new field to the corresponding 'nb_cb_x_args' structure, without needing to update any instance of that callback in any daemon. This commit includes a .cocci semantic patch that can be used to update old code to the new format automatically. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | *: replace all random() callsRafael Zalamena2020-04-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | Merge pull request #6247 from FRRouting/nb_conversionsDonald Sharp2020-04-171-0/+1
|\ \ | | | | | | Merge nb_converions branch to master
| * | *: include vrf northbound module in initChirag Shah2020-04-161-0/+1
| |/ | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | Merge pull request #6135 from opensourcerouting/cli-node-cleanupDonald Sharp2020-04-171-8/+12
|\ \ | | | | | | *: clean up the mess that is CLI command nodes
| * | *: move CLI node names to cmd_node->nameDavid Lamparter2020-04-161-0/+2
| | | | | | | | | | | | | | | | | | | | | And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
| * | *: move CLI parent data to cmd_node->parent_nodeDavid Lamparter2020-04-161-0/+2
| | | | | | | | | | | | | | | | | | | | | Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | *: remove second parameter on install_node()David Lamparter2020-04-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
| * | *: remove cmd_node->vtyshDavid Lamparter2020-04-161-2/+0
| | | | | | | | | | | | | | | | | | | | | The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | *: clean up cmd_node initializersDavid Lamparter2020-04-161-6/+6
| |/ | | | | | | | | | | ... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #5451 from opensourcerouting/rcu-logSantosh P K2020-04-161-0/+1
|\ \ | |/ |/| logging subsystem rewrite
| * lib: rewrite zlog lock-free & TLS-bufferedDavid Lamparter2020-04-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a full rewrite of the "back end" logging code. It now uses a lock-free list to iterate over logging targets, and the targets themselves are as lock-free as possible. (syslog() may have a hidden internal mutex in the C library; the file/fd targets use a single write() call which should ensure atomicity kernel-side.) Note that some functionality is lost in this patch: - Solaris printstack() backtraces are ditched (unlikely to come back) - the `log-filter` machinery is gone (re-added in followup commit) - `terminal monitor` is temporarily stubbed out. The old code had a race condition with VTYs going away. It'll likely come back rewritten and with vtysh support. - The `zebra_ext_log` hook is gone. Instead, it's now much easier to add a "proper" logging target. v2: TLS buffer to get some actual performance Signed-off-by: David Lamparter <equinox@diac24.net>
* | bfdd: add more zebra debug messagesRafael Zalamena2020-04-141-25/+22
| | | | | | | | | | | | Uncomment old debug about relayed messages from zebra. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: constify satostrRafael Zalamena2020-04-142-4/+4
| | | | | | | | | | | | Detect modifications to the `sockaddr_any` struct. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: remove time calculation debugsRafael Zalamena2020-04-141-16/+0
| | | | | | | | | | | | These were disabled by default and not used by a long time. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: simplify code flowRafael Zalamena2020-04-144-30/+5
| | | | | | | | | | | | | | Don't attempt to handle out-of-memory situations: XMALLOC/XCALLOC will `assert` if there is no memory left. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: add debug fine tuning capabilitiesRafael Zalamena2020-04-145-68/+208
| | | | | | | | | | | | | | | | | | | | | | | | Move most of the log messages to debug guards so they only get activated if the user configured the proper debug level. Current debug levels: - Peer events. - Zebra events. - Network layer debugs. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: use standard log macrosRafael Zalamena2020-04-109-197/+206
| | | | | | | | | | | | Remove old log_* macros and standardize on FRR's logging infrastructure. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: fix transmission timer calculationRafael Zalamena2020-04-091-8/+7
| | | | | | | | | | | | | | According to the RFC 5880 the transmission time should be mandated by the slowest system. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: initialize packet data with zeroesRafael Zalamena2020-04-091-1/+1
| | | | | | | | | | | | | | Lets avoid garbage data on packets by zeroing the packet before setting the fields/flags. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: remove BFD_*_FLAG macrosRafael Zalamena2020-04-099-73/+69
|/ | | | | | Lets use what FRR provide us instead of implementing a new macros. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: fix -Wundef warningRuben Kerkhof2020-03-301-1/+1
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: fix format string warningsDavid Lamparter2020-03-291-3/+3
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>