summaryrefslogtreecommitdiffstats
path: root/bfdd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bfdd: Json fields for multiplierSumitAgarwal1232019-12-041-7/+14
| | | | | | | Adding fields "detect-multiplier" and "remote-detect-multiplier" for JSON to to reflect changes in "show bfd peers output" Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
* bfdd: Adding new CLI, show bfd peers briefSumitAgarwal1232019-12-043-1/+98
| | | | | | Added new CLI to display all BFD peer in brief format Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
* bfdd: Adding new cli, clear bfd countersSumitAgarwal1232019-12-041-0/+40
| | | | | | | | Adding new CLI clear bfd counters, This CLI wil only reset Rx/Tx counters, it will not reset session UP/DOWN and Zebra event count Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
* bfdd: Adding new fields to display show bfd peerSumitAgarwal1232019-12-041-0/+6
| | | | | | | | Adding 2 two new fields 1. Peer type, configured/dynamic 2. Detect multiplier Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
* *: generously apply constDavid Lamparter2019-12-022-5/+5
| | | | | | const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
* *: make frr_yang_module_info constDavid Lamparter2019-11-301-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* Merge pull request #5274 from opensourcerouting/bfdd-vrf-socketRuss White2019-11-193-24/+28
|\ | | | | bfdd: VRF security improvement
| * bfdd: bind VRF sockets to devicesRafael Zalamena2019-11-043-24/+28
| | | | | | | | | | | | | | | | Always bind the created sockets to their respective VRF devices. With this it should be possible to run BFD on VRFs without needing to weaken the security setting `net.ipv4.udp_l3mdev_accept=1`. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: remove unused initialization sa warningMark Stapp2019-11-141-1/+2
|/ | | | | | | There's a variable initialization that's triggering an SA warning - don't do that. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* bfdd: split northbound callbacks into multiple filesRenato Westphal2019-10-309-1268/+1514
| | | | | | | | | | | | | | | | Rearrange the bfdd northbound callbacks as following: * bfd_nb.h: prototypes of all northbound callbacks. * bfd_nb.c: definition of all northbound callbacks and their associated YANG data paths. * bfd_nb_config.c: implementation of YANG configuration nodes. * bfd_nb_state.c: implementation of YANG state nodes. This should help to keep to code more organized and easier to maintain. No behavior changes intended. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #5197 from SumitAgarwal123/BFD_ADMIN_DOWNRafael Zalamena2019-10-295-13/+58
|\ | | | | bfdd: Handling local and remote admin-down
| * bfdd: Handling local and remote admin-downSumitAgarwal1232019-10-295-13/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scenarios where this code change is required: 1. BFD is un-configured from BGP at remote end. Neighbour BFD sends ADMIN_DOWN state, but BFD on local side will send DOWN to BGP, resulting in BGP session DOWN. Removing BFD session administratively shouldn't bring DOWN BGP session at local or remote. 2. BFD is un-configured from BGP or shutdown locally. BFD will send state DOWN to BGP resulting in BGP session DOWN. (This is akin to saying do not use BFD for BGP) Removing BFD session administratively shouldn't bring DOWN BGP session at local or remote. Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
* | bfdd: VRF and CoverityDonald Sharp2019-10-262-2/+2
| | | | | | | | | | | | Fixup a couple of Coverity issues surrounding pointers Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bfdd: don't allow link-local without interfaceRafael Zalamena2019-10-111-0/+26
| | | | | | | | | | | | | | | | | | When using link-local addresses we must provide scope-id to the operating system so it knows where to send packets. Spotted by Pavel Ivashchenko (@zays26). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: simplify session observers codeRafael Zalamena2019-10-113-31/+5
| | | | | | | | | | | | | | | | Don't be selective about what to observe, always observe all possible aspects of the session that may change on run-time (i.e. bind address, interface and VRF existence). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: set session down after disabling itRafael Zalamena2019-10-111-3/+13
| | | | | | | | | | | | | | | | If a session is no longer able to send/receive packets, it is very likely it will be down in a few milliseconds so lets speed up the process and correctly mark it as down. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: disable sockets polling before closing itRafael Zalamena2019-10-111-0/+9
| | | | | | | | | | | | | | Otherwise the `thread_read` will keep waking us up to handle closing sockets which are never unregistered. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | bfdd: upon vrf disable, unlink bfd session with vrfPhilippe Guibert2019-10-111-0/+1
| | | | | | | | | | | | | | bfd session has a vrf pointer that needs to be reset, when vrf is disabled. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | bfdd: Fixing coredump in logSumitAgarwal1232019-10-111-1/+1
| | | | | | | | | | | | Param missing in debug log, leading to coredump Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
* | *: remove redundant brackets in commandsIgor Ryzhov2019-10-081-4/+4
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #5009 from donaldsharp/interface_deletionRuss White2019-09-301-28/+9
|\ \ | | | | | | lib, zebra: Allow for interface deletion when kernel event happens
| * | *: Convert zapi->interface_delete to ifp callbackDonald Sharp2019-09-191-18/+1
| | | | | | | | | | | | | | | | | | | | | Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | *: Switch all zclient->interface_add to interface create callbackDonald Sharp2019-09-191-15/+2
| | | | | | | | | | | | | | | | | | | | | Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | *: Add infrastructure to support zapi interface callbacksDonald Sharp2019-09-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | *: fix missing VRF autocompletionsIgor Ryzhov2019-09-241-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | Current autocompletion works only for simple "vrf NAME" case. This commit expands it also for the following cases: - "nexthop-vrf NAME" in staticd - usage of $varname in many daemons All daemons are updated to use single varname "$vrf_name". Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* / Revert "lib: introduce a read-write lock for northbound configurations"Renato Westphal2019-09-181-10/+5
|/ | | | | | | | | | | | | | | | | Adding a lock to protect the global running configuration doesn't help much since the FRR daemons are not prepared to process configuration changes in a pthread that is not the main one (a whole lot of new protections would be necessary to prevent race conditions). This means the lock added by commit 83981138 only adds more complexity for no benefit. Remove it now to simplify the code. All northbound clients, including the gRPC one, should either run in the main pthread or use synchronization primitives to process configuration transactions in the main pthread. This reverts commit 83981138fe8c1e0a40b8dede74eca65449dda5de.
* Merge pull request #4564 from pguibert6WIND/misc_vrf_update_nameRuss White2019-09-174-5/+81
|\ | | | | Misc vrf update name
| * bfdd: change vrf name with bypassing nb apiPhilippe Guibert2019-08-271-0/+45
| | | | | | | | | | | | | | | | bfd operational & config data may already applied and available, while an external event requests for changing the vrf name. this change updates the config and operational context of yang. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * bfdd: update vrf name of bfd session if necessaryPhilippe Guibert2019-08-273-0/+17
| | | | | | | | | | | | | | if the bfd session is already enabled, then dynamically change the vrf name if the vrf where bfd is executed changed its name. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * bfdd: add the vrf update hook in case vrf name changesPhilippe Guibert2019-08-271-1/+11
| | | | | | | | | | | | | | in case vrf name changes, use a hook to be notified about the vrf change. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * bfdd: if no vrfname is passed, use default vrf namePhilippe Guibert2019-08-271-0/+3
| | | | | | | | | | | | | | default vrf name is used to forge the key that permits storing the session. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * bfdd: add vrf information as key element for bfd session searchPhilippe Guibert2019-08-272-4/+5
| | | | | | | | | | | | the default vrf is looked up, in the search list algorithm. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #4604 from opensourcerouting/mutex-sugarQuentin Young2019-09-031-8/+8
|\ \ | | | | | | mutex syntactic sugar
| * | *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-031-8/+8
| |/ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* / bfdd: close bfd echo sockets, upon vrf disablePhilippe Guibert2019-09-031-0/+2
|/ | | | | | | | | | | | | upon vrf disable, an event informs bfd daemon that the vrf contexts should be removed. in the case a vrf backend is netns based, all sockets opened under that netns have to be closed. otherwise it is impossible for the system to completely close the network namespace. that implies that some interfaces may not be deleted, and may not be given back to default vrf. PR=65291 Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Acked-by: Julien Floret <julien.floret@6wind.com>
* bfdd: keep source information for single hopRafael Zalamena2019-07-091-1/+7
| | | | | | | | | | Add source address to northbound when creating sessions with this information. It is not possible to change source address after the session was created, but we should be able to set it to make IPv6 work. Spotted by Philippe Guibert. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: fix some CI warningsRafael Zalamena2019-07-022-24/+14
| | | | | | Use `static` functions for file local functions to please `check_patch.pl`. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: convert `bfd` command to northboundRafael Zalamena2019-06-252-11/+17
| | | | | | | This helps northbound to create the `bfd` node on the configuration output sooner than adding a peer. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: small tweaks on northboundRafael Zalamena2019-06-251-9/+1
| | | | | | | | | | * Change `ERR_VALIDATION` to `ERR_INCONSISTENCY` to error on inconsistent state. * Duplicated sanity checks: * Remove detection multiplier sanity check. * Remove duplicated session sanity check. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: fix compilation warnings on OmniOSRafael Zalamena2019-06-242-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build will fail with `Werror` enabled with: ``` CC bfdd/bfdd_cli.o In file included from ./lib/frratomic.h:21:0, from ./lib/memory.h:22, from ./lib/vector.h:25, from ./lib/command.h:25, from bfdd/bfdd_cli.c:23: ./config.h:665:0: error: "_FILE_OFFSET_BITS" redefined [-Werror] #define _FILE_OFFSET_BITS 64 ^ In file included from /usr/include/iso/stdlib_iso.h:49:0, from /usr/include/stdlib.h:37, from ./lib/memory.h:20, from ./lib/vector.h:25, from ./lib/command.h:25, from bfdd/bfdd_cli.c:23: /opt/gcc-5.1.0/lib/gcc/i386-pc-solaris2.11/5.1.0/include-fixed/sys/feature_tests.h:231:0: note: this is the location of the previous definition #define _FILE_OFFSET_BITS 32 ^ In file included from ./lib/thread.h:24:0, from ./lib/vty.h:27, from ./lib/command.h:26, from bfdd/bfdd_cli.c:23: ./lib/zebra.h:271:2: error: #warning "assuming 4-byte alignment for CMSG_SPACE" [-Werror=cpp] #warning "assuming 4-byte alignment for CMSG_SPACE" ^ ./lib/zebra.h:277:2: error: #warning "assuming 4-byte alignment for CMSG_LEN" [-Werror=cpp] #warning "assuming 4-byte alignment for CMSG_LEN" ^ cc1: all warnings being treated as errors Makefile:6876: recipe for target 'bfdd/bfdd_cli.o' failed gmake[1]: *** [bfdd/bfdd_cli.o] Error 1 ``` Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: fix compilation warnings on OpenBSDRafael Zalamena2019-06-241-80/+188
| | | | | | | | | | | | | | Build will fail with `Werror` enabled with: ``` bfdd/bfdd_northbound.c:876: warning: initialized field overwritten bfdd/bfdd_northbound.c:876: warning: (near initialization for 'frr_bfdd_info.nodes[0].cbs') ... cc1: error: unrecognized command line option "-Wno-unused-result" gmake[1]: *** [Makefile:6875: bfdd/bfdd_northbound.o] Error 1 ``` Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: authorise multihop and interface settingPhilippe Guibert2019-06-221-6/+0
| | | | | | | the restriction to authorise multihop and interface setting has no meaning here. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: add not '\n' to shutdown help stringPhilippe Guibert2019-06-221-1/+1
| | | | | | | help string had not a '\n' at the end of the line for bfd shutdown help command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: use microseconds timers in YANGRafael Zalamena2019-06-222-27/+39
| | | | | | | | | | Lets allow specification to accept microseconds, but limit the timers configuration in FRR to milliseconds (minimum is 10 ms and maximum is 60 seconds). This matches the RFC 5880 and the IETF BFD YANG draft model. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: support global BFD resetRafael Zalamena2019-06-224-5/+98
| | | | | | | Add command 'no bfd' to remove all BFD sessions configuration and fix other daemon integration. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: fix daemon warning on startupRafael Zalamena2019-06-221-0/+4
| | | | | | | | | | ``` warnings: BFD: [EC 100663317] YANG model "frr-bfdd@*" not embedded, trying external file ``` Embed the YANG model into the binary to avoid reading an external file. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: implement configuration reloadRafael Zalamena2019-06-221-0/+15
| | | | | | Reload configuration on SIGHUP using the northbound. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: fix northbound remote-discriminator displayRafael Zalamena2019-06-221-0/+3
| | | | | | | | When the remote discriminator hasn't been assigned yet, then we can't return a value of 0. The value '0' is an invalid discriminator and the yang handlers will complain about it. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: implement write_config using northboundRafael Zalamena2019-06-224-77/+176
| | | | | | | Move all the `show running-config` logic to the new northbound implementation. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: migrate session commands to northboundRafael Zalamena2019-06-227-279/+1393
| | | | | | | | | | | Lets start using the new BFD yang model and translate the BFD session configuration commands to use the northbound. One important change: all sessions will default to use `VRF_DEFAULT_NAME` (usually "default") when no VRF is configured. All places which search for BFD sessions must now take this into account. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>