summaryrefslogtreecommitdiffstats
path: root/ldpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: 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>
* *: Convert interface_down to interface down callbackDonald Sharp2019-09-191-23/+6
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert from ->interface_up to the interface callbackDonald Sharp2019-09-191-12/+17
| | | | | | | For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Switch all zclient->interface_add to interface create callbackDonald Sharp2019-09-191-11/+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/+23
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lib, zebra: add new MPLS zapi message with route replace semanticsRenato Westphal2019-09-101-10/+13
| | | | | | | This new message makes it possible to install/reinstall LSPs with multiple nexthops using a single ZAPI message. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib, zebra: enhance the MPLS zapi messagesRenato Westphal2019-09-071-12/+35
| | | | | | | | | | * Add ability to specify the nexthop type; * Add ability to install or not a FTN (in addition to an LSP). These two additions will be useful to install local SR Prefix-SIDs configured with the no-PHP option. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: identify MPLS FTNs by route type and instanceRenato Westphal2019-09-076-26/+39
| | | | | | | | | Use the route type and instance instead of the route distance to identify MPLS FTNs. This is a more robust approach since the routing daemons can modify the distance of their announced routes via configuration, which can cause inconsistencies. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: introduce encode/decode functions for the MPLS zapi messagesRenato Westphal2019-09-071-26/+17
| | | | | | | | | Do this for the following reasons: * Improve modularity of the code by separating the decoding of the ZAPI messages from their processing; * Create an API that is easier to use by the client daemons. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-031-4/+4
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ldpd: Fix to release MPLS label if its not used anymoreBinu Abraham2019-07-153-0/+43
| | | | | | LDP should release labels allocated from zebra if its not getting used. Signed-off-by: Binu <binu_abraham@looptelecom.com>
* ldpd: set default instance to 1Emanuele Di Pascale2019-07-101-0/+3
| | | | | | | | | | | | | LDP opens two sockets to zebra, one through ldpd (always using instance 0) and another through lde (using whatever instance was set through the -n command line parameter). If no instance was set, both connections would use the same protocol and instance, making it impossible to distinguish them through zserv_find_client. This meant that a response to a lm connect would erroneously go to the wrong process. Fix this by having a default instance value of 1, in case the user does not specify a different one. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* lib, zebra: support label chunk requests for SRGBEmanuele Di Pascale2019-07-101-1/+2
| | | | | | | | | | | | | | | | For SRGB, we need to support chunk requests starting at a specific point in the label space, rather than just asking for any sufficiently large chunk. To this purpose, we extend the label manager api to request a chunk with a base value; if the base is set to 0, the label manager will behave as it currently does, i.e. fetching the first free chunk big enough to satisfy the request. update all the existing calls to get chunks from the label manager so that they use MPLS_LABEL_BASE_ANY as the base for the requested chunk Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* ldpd: fix clang-SA warning in packet readingDavid Lamparter2019-06-131-0/+5
| | | | | | clang-SA thinks we can skip the SA but have something allocated in buf. Signed-off-by: David Lamparter <equinox@diac24.net>
* ldpd: Fix shutdowndturlupov2019-06-111-1/+1
| | | | | | | When we stopped ldpd, we get fatal error message from wait(). This commit fix it. Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
* ldpd: Allow for -N <namespace> to influence location of LDPD_SOCKETDonald Sharp2019-06-041-1/+10
| | | | | | | | | | | | If --ctl_socket is used this will override any other option and will be used If -N <namespace> is used, then we will setup the LDPD_SOCKET in $frr_statedir/<namespace>/ldpd.sock If neither option is used, then we will use $frr_statedir/ldpd.sock Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young2019-05-031-36/+20
| | | | | | | | | | | | 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>
* build: fix a whole bunch of *FLAGSDavid Lamparter2019-01-301-1/+1
| | | | | | | | | - some target_CFLAGS that needed to include AM_CFLAGS didn't do so - libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all - consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@ - 2 dependencies were missing for clippy Signed-off-by: David Lamparter <equinox@diac24.net>
* ldpd: fix corner case in which we wouldn't respect the max pdu lengthRenato Westphal2019-01-221-2/+2
| | | | | | | | | The calculation to know when an LDP PDU went past the maximum negotiated PDU length was wrong because it wasn't taking the "Version" and "PDU Length" fields into account (total of four bytes). Fix this. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ldpd: fix missing return value in bindanyMark Stapp2019-01-161-0/+1
| | | | | | | One of the socket utilities was missing a return value in one of its ifdef'd paths. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* ldpd: fix startup on OpenBSDRafael Zalamena2018-12-221-8/+10
| | | | | | | We must open the PF_KEY socket before dropping privileges, otherwise the socket creation will fail with permission problems. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* ldpd: add support for FreeBSD IP_BINDANYRafael Zalamena2018-12-211-2/+11
| | | | | | | Add yet another way to setsockopt a socket to listen to a foreign address. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* *: remove the configuration lock from all daemonsRenato Westphal2018-11-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | A while ago all FRR configuration commands were converted to use the QOBJ infrastructure to keep track of configuration objects. This means the configuration lock isn't necessary anymore because the QOBJ code detects when someones tries to edit a configuration object that was deleted and react accordingly (log an error and abort the command). The possibility of accessing dangling pointers doesn't exist anymore since vty->index was removed. Summary of the changes: * remove the configuration lock and the vty_config_lockless() function. * rename vty_config_unlock() to vty_config_exit() since we need to clean up a few things when exiting from the configuration mode. * rename vty_config_lock() to vty_config_enter() to remove code duplication that existed between the three different "configuration" commands (terminal, private and exclusive). Configuration commands converted to the new northbound model don't need the configuration lock either since the northbound API also detects when someone tries to edit a configuration object that doesn't exist anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Replace zclient_new with zclient_new_notifyDonald Sharp2018-11-122-2/+2
| | | | | | | It's been a year since we added the new optional parameters to instantiation. Let's switch over to the new name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: add empty array of YANG modulesRenato Westphal2018-10-271-0/+6
| | | | | | | | | | FRR_DAEMON_INFO should now contain an array of 'frr_yang_module_info' structures describing the YANG modules implemented by the daemon. This array will be used by frr_init() function to load all YANG modules and initialize the northbound callbacks during the daemon initialization. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: introduce new northbound APIRenato Westphal2018-10-271-1/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: spelchekDavid Lamparter2018-10-252-2/+2
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd, doc, ldpd, lib, tests, zebra: LM fixespaco2018-09-181-1/+1
| | | | | | | | | | | | | Corrections so that the BGP daemon can work with the label manager properly through a label-manager proxy. Details: - Correction so the BGP daemon behind a proxy label manager gets the range correctly (-I added to the BGP daemon, to set the daemon instance id) - For the BGP case, added an asynchronous label manager connect command so the labels get recycled in case of a BGP daemon reconnection. With this, BGPd and LDPd would behave similarly. Signed-off-by: F. Aragon <paco@voltanet.io>
* Merge pull request #3040 from pacovn/static_analysis__drop_const_1Quentin Young2018-09-173-7/+7
|\ | | | | bgpd isisd ldpd lib: const drop fixes (SA)
| * bgpd isisd ldpd lib: const drop fixes (SA)F. Aragon2018-09-173-7/+7
| | | | | | | | | | | | Can be detected with e.g. ./configure CFLAGS=-Wcast-qual CC=clang Signed-off-by: F. Aragon <paco@voltanet.io>
* | *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-1/+1
|/ | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #2977 from opensourcerouting/doc-fixDonald Sharp2018-09-091-1/+1
|\ | | | | build: fix not building docs w/o sphinx
| * build: fix not building docs w/o sphinxDavid Lamparter2018-09-091-1/+1
| | | | | | | | | | | | Can't build manpages without sphinx-build, oops... Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #2965 from opensourcerouting/buildfoo-20180904Donald Sharp2018-09-091-0/+4
|\ \ | |/ |/| more build fixes & warning-free build
| * *: fix config.h/zebra.h include orderDavid Lamparter2018-09-081-0/+4
| | | | | | | | | | | | | | | | config.h (or, transitively, zebra.h) must be the first include file listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work correctly. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #2862 from opensourcerouting/non-recursiveDonald Sharp2018-09-092-15/+2
|\| | | | | final non-recursive make
| * *: cleanup .gitignore filesDavid Lamparter2018-09-081-15/+0
| | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
| * build: move vtysh & manpage listings to subdir.amDavid Lamparter2018-09-081-0/+2
| | | | | | | | | | | | | | Since we're now building through one large Makefile, we can easily put things with their daemons and crossreference nicely. Signed-off-by: David Lamparter <equinox@diac24.net>
* | lib, ldpd: fix SA warnings from TAILQ oddnessDavid Lamparter2018-09-081-3/+1
|/ | | | | | | Add a TAILQ_POP_FIRST so Clang understands it's the same item that is getting removed from the list. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: add a vrf update hook to be informed of the vrf namePhilippe Guibert2018-08-281-1/+1
| | | | | | | | The Vrf aliases can be known with a specific hook. That hook will then, from zebra propagate the information to the relevant zapi clients. The registration hook function is the same for all daemons. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: use frr_elevate_privs() (2/2: manual)David Lamparter2018-08-141-26/+14
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: use frr_elevate_privs() (1/2: coccinelle)David Lamparter2018-08-141-10/+6
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: rename ferr_zlog -> flog_err_sysQuentin Young2018-08-141-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ldpd: Convert to using LIB_ERR_XXX and zlog_ferrDonald Sharp2018-08-141-2/+4
| | | | | | | convert ldpd over to using zlog_ferr and LIB_ERR_XXX where appropriate. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ldpd: use DEFPY_NOSH whenever possibleRenato Westphal2018-08-131-39/+15
| | | | | | | | | All ldpd commands were written using DEFPY except the ones that needed to be ignored by vtysh, in which case we were using DEFUN_NOSH. Now that DEFPY_NOSH is available, convert the remaining commands for consistency and to simplify the code a little bit. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ldpd: add missing command under the ipv6 address-family nodeRenato Westphal2018-07-241-0/+1
| | | | | | Bug found by Patrick Velder. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ldpd: buffer underflow, thread safety (PVS-Studio)F. Aragon2018-07-046-51/+46
| | | | | | | | | | This commit fixes two issues: - memcpy() using containers of different sizes when using addr2sa(), mixing 'struct sockaddr_storage' and 'union sockunion'. - addr2sa() function not being thread safe (using a local static variable as container. Signed-off-by: F. Aragon <paco@voltanet.io>
* ldpd: null check (Coverity 1452317)paco2018-06-251-0/+3
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* Merge pull request #2449 from donaldsharp/lib_delayed_readLou Berger2018-06-221-1/+18
|\ | | | | Lib delayed read