summaryrefslogtreecommitdiffstats
path: root/bfdd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* bfdd: remove the label commandRafael Zalamena2019-06-221-22/+0
| | | | | | This command has no use for CLI and is relevant for the control socket only. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bfdd: export some private functionsRafael Zalamena2019-06-222-11/+22
| | | | | | | These functions are going to be used by the future northbound implementation to handle BFD sessions. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* Merge pull request #4536 from pguibert6WIND/bfd_startup_does_not_workDonald Sharp2019-06-221-35/+35
|\ | | | | bfdd: avoid double socket initialisation on same netns
| * bfdd: avoid double socket initialisation on same netnsPhilippe Guibert2019-06-211-35/+35
| | | | | | | | | | | | | | | | | | | | | | when working with a standard vrf backend, bfdd ignores that and tries to create and configure bfd sockets for each vrf, which will fail for the second vrf discovered, since the network namespace used is the same, and it is not possible to use same socket settings twice. Handle this case, and avoids to reinitialise sockets. This patch however does not leverage bfd support for vrf-lite. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | bfdd: use MTYPE_STATICDavid Lamparter2019-06-214-19/+14
|/ | | | | | | MTYPE definitions should be local to the file using them whereever possible. Also remove some superfluous ; Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib,bgpd,babeld,ripngd,nhrpd,bfdd: clean up SA warningsMark Stapp2019-06-061-6/+8
| | | | | | Clean up several SA warnings. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* Merge pull request #4431 from donaldsharp/mad_gainzRafael Zalamena2019-06-051-2/+10
|\ | | | | Switch over to `-N FOO` adding FOO to the various directories/files we open up
| * bfdd: Allow -N to influence BFDD_CONTROL_SOCKETDonald Sharp2019-06-041-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | When selecting to run bfdd with -N allow the namespace passed in to be added to the $frr_statedir/<namespace name>/bfdd.sock If --bfdctl is passed in that will override the -N option. If neither --bfdctl or -N is passed in then the default of $frr_statedir/bfdd.sock is used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bfdd: Modify bfdd to quietly accept access-listsDonald Sharp2019-06-051-0/+4
|/ | | | | | | | The `access-list ...` command was causing bfdd to return 'unknown commands'. Make bfdd at least cognizant of access-lists enough to not create strange error messages Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #4144 from pguibert6WIND/bfd_cbitRuss White2019-05-165-2/+41
|\ | | | | BFD CBIT
| * bfdd, lib, bgpd: add bfd cbit usagePhilippe Guibert2019-05-145-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd cbit is a value carried out in bfd messages, that permit to keep or not, the independence between control plane and dataplane. In other words, while most of the cases plan to flush entries, when bfd goes down, there are some cases where that bfd event should be ignored. this is the case with non stop forwarding mechanisms where entries may be kept. this is the case for BGP, when graceful restart capability is used. If BFD event down happens, and bgp is in graceful restart mode, it is wished to ignore the BFD event while waiting for the remote router to restart. The changes take into account the following: - add a config flag across zebra layer so that daemon can set or not the cbit capability. - ability for daemons to read the remote bfd capability associated to a bfd notification. - in bfdd, according to the value, the cbit value is set - in bfdd, the received value is retrived and stored in the bfd session context. - by default, the local cbit announced to remote is set to 1 while preservation of the local path is not set. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | lib: hashing functions should take const argumentsQuentin Young2019-05-141-6/+6
|/ | | | | | | | | | It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bfd: add bfdd_privs to the bglobal structurePhilippe Guibert2019-05-073-28/+31
| | | | | | | | this structure contains the bfdd_privs structure in charge of the privilege settings. The initialisation has moved a bit, in order that the preinit settings are done. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: show bfd [vrf NAME] peer command changePhilippe Guibert2019-05-071-6/+5
| | | | | | | | | the vrf keyword is possible through show bfd command. However, there is a change with previous version, since that show command was accepting vrf keyword, only after peer keyword. Now, the vrf keyword is accepted, but before peer keyword. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: add show bfd [vrf NAME] counters commandPhilippe Guibert2019-05-071-7/+41
| | | | | | that command permits to filter bfd peer counter contexts per vrf. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: add show bfd [vrf NAME] peers commandPhilippe Guibert2019-05-071-8/+48
| | | | | | | this command permits to filter among the list of bfd peers which one is to be displayed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: avoid creating duplicate peer contextsPhilippe Guibert2019-05-071-7/+80
| | | | | | | | | | | | | | | | | | | | | | | | | when configuring bfd peers, some parameters may or may not be taken into account to search for a previous context. This has as consequence that the result is different with the order of vty commands: bfd peer 4.5.6.7 vrf AAAA local-address 1.2.3.5 end peer 4.5.6.7 vrf AAAA <--- should not create new session end Similarly, the user thinks it has overwritten some key parameters like local address, whereas it is wrong. here, some informational message should be present. bfd peer 4.5.6.7 vrf AAAA end peer 4.5.6.7 vrf AAAA local-address 1.2.3.5 <--- should inform that the key lookup 1.2.3.5 is wrong end Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: do not insert obs entry in the list, once disabledPhilippe Guibert2019-05-071-1/+0
| | | | | | the bfd entry has not to be inserted in the obs list again. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: check bfd on upon interface presence from separate vrfPhilippe Guibert2019-05-071-2/+8
| | | | | | | if a separate vrf detects a new interface, then some bfd sessions may be run. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: upon vrf enable/disable, update bs and obs listPhilippe Guibert2019-05-073-2/+54
| | | | | | | | parse observer list, and update bs context if vrf pointer is not yet populated. this is helpful for validation, but also will permit bfd to send notification to remote daemon. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: register to interfaces from other vrfsPhilippe Guibert2019-05-073-0/+23
| | | | | | registration for new interfaces is done. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd, zebra: pass the vrf identifier between zebra and bfddPhilippe Guibert2019-05-071-11/+26
| | | | | | | messages from daemons to bfd daemons go through zebra. zebra reuses the vrf identifier to send messages to bfd. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: socket handling per vrf contextPhilippe Guibert2019-05-074-89/+169
| | | | | | sockets are created foreach network namespace context enabled. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: add vrf frameworkPhilippe Guibert2019-05-073-0/+36
| | | | | | | vrf initialisation is done. hooks are installed. no specific action is done, except the vrf initialisation. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: use vrf api for creation socket with binding with vrf litePhilippe Guibert2019-05-075-134/+16
| | | | | | | in the case vrf-lite is used, it is possible to call SO_BINDTODVICE, by using vrf_socket() call. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: permit to configure both iface and vrfPhilippe Guibert2019-05-072-18/+17
| | | | | | | it is possible to configure both iface and vrfname. also, the appropriate vrf is used, in case an iface is given. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: add sys_admin capability and net_raw capabilityPhilippe Guibert2019-05-071-1/+1
| | | | | | | | in order to be able to create sockets on separate namespaces, add the privs setting needed. the former capability is needed to use SO_BINDTODEVICE option. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: socket creation in a vrf can be donePhilippe Guibert2019-05-072-3/+10
| | | | | | vrf_socket() call is performed instead of socket() call. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: remove the constraint of bfd vrf and multihopPhilippe Guibert2019-05-071-5/+1
| | | | | | | there is no specific constraints that should prevent from configuring a multihop bfd session within a bfd session. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: move bfd_ses_[xx] to bfd_sess_[xx] like other routinesPhilippe Guibert2019-05-075-14/+14
| | | | | | | this is a change to be more consistent with function naming convention in bfd. a small change for 3 functions. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bfdd: use logging convention for remaining zlog_debugPhilippe Guibert2019-05-071-1/+1
| | | | | | | zlog_debug is being replaced with log_debug, because all bfdd code uses that way of logging information. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young2019-05-031-18/+9
| | | | | | | | | | | | This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>