summaryrefslogtreecommitdiff
path: root/ldpd/lde.h
AgeCommit message (Collapse)Author
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-03ldpd: make allowing broken-lsps to be installed with pop operation configurablelynne
If LDP is miss configured in a setup and the router has LSPs with no remote label, this code installs the LSP with a pop instruction of the top-level label so the packet can be forwarded using IP. This is a best-effort attempt to deliver labeled IP packets to their final destination instead of dropping them. If this config is turned off the code will only install LSPs that have a valid remote label. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-01-15ldpd: fix sporadic failures in the ldp-topo1 topotestRenato Westphal
Commit 220e848cc5 introduced an optimization that would prevent ldpd from sending redundant label mappings when it receives notifications from zebra about routes that didn't effectively change (such notifications can happen under certain circumstances). The problem is that that commit didn't take into account the metric of the received routes, so it would dismiss a notification of a route with a better metric taking the place of another route in the RIB, preventing the newly selected route from receiving the label mappings it needs. Revert 220e848cc5 temporarily to fix sporadic failures in the CI system until we have a better solution. Debugged-by: Lynne Morrison lynne@voltanet.io Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-01-08ldpd: add support for RLFA clientsRenato Westphal
Add an API that allows IGP client daemons to register/unregister RLFAs with ldpd. IGP daemons need to be able to query the LDP labels needed by RLFAs and monitor label updates that might affect those RLFAs. This is similar to the NHT mechanism used by bgpd to resolve and monitor recursive nexthops. This API is based on the following ZAPI opaque messages: * LDP_RLFA_REGISTER: used by IGP daemons to register an RLFA with ldpd. * LDP_RLFA_UNREGISTER_ALL: used by IGP daemons to unregister all of their RLFAs with ldpd. * LDP_RLFA_LABELS: used by ldpd to send RLFA labels to the registered clients. For each RLFA, ldpd needs to return the following labels: * Outer label(s): the labels advertised by the adjacent routers to reach the PQ node; * Inner label: the label advertised by the PQ node to reach the RLFA destination. For the inner label, ldpd automatically establishes a targeted neighborship with the PQ node if one doesn't already exist. For that to work, the PQ node needs to be configured to accept targeted hello messages. If that doesn't happen, ldpd doesn't send a response to the IGP client daemon which in turn won't be able to activate the previously computed RLFA. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-01-08ldpd: detect when route received from zebra hasn't changedRenato Westphal
Add some code to detect when a route received from zebra hasn't changed and ignore the notification in that case, preventing ldpd from sending unnecessary label mappings. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-09-04ldpd: Fix issue when starting up LDP with no configuration.lynne
LDP would mark all routes as learned on a non-ldp interface. Then when LDP was configured the labels were not updated correctly. This commit fixes issues 6841 and 6842. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2020-07-20ldpd: process pw-status in received orderKaren Schoener
Update LDP to process received pw-status in received order. Update LDP to save pw-status regardless of whether the PW is configured. When the PW is configured, LDP checks for any saved PW pw-status. Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-04-29ldpd: fix ACL rule modificationlynne
Changes to ACL rules were not applied to LDP. This fix allows LDP to be notified when a rule in an ACL filter is modified by the user. The filter is properly applied to the LDP session. The filter may cause a LDP session to go down/up or to remove/add labels being advertised/received from a neighbor. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-04-01ldpd: fixing host-only configuration filter.lynne
There is configuration in LDP to only create labels for host-routes. If the user remove this configuration the code was not readvertising non-host routes to it's LDP neighbors. The issue is the same in reverse also. If the user adds this configuration on an active LDP session the non-host routes were not withdrawn. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2020-03-20ldpd: adding support for LDP ordered label distribution controlKaren Schoener
LDP ordered label distribution control only binds a label to a FEC if it is the egress LSR, or the router received a label binding for a FEC from the next hop router. In this mode, an MPLS router will create a label binding for each FEC and distribute it to its neighbors so long as he has a entry in the RIB for the destination. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2019-09-06zebra: identify MPLS FTNs by route type and instanceRenato Westphal
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>
2019-07-15ldpd: Fix to release MPLS label if its not used anymoreBinu Abraham
LDP should release labels allocated from zebra if its not getting used. Signed-off-by: Binu <binu_abraham@looptelecom.com>
2017-08-17lib: standardize use of queue.hJorge Boncompte
The simple queue implementation in OpenBSD and FreeBSD are called diferently, standardize in the use of the FreeBSD version and map the missing names only if we compile on OpenBSD. Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-09ldpd: integrate with the pseudowire manager in zebraRenato Westphal
If we receive a notification from zebra indicating that the installation of a pseudowire has failed (e.g. no reachability), send a PW Status notification to the remote peer (or a Label Withdraw if the remote peer doesn't support the PW Status TLV). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-26ldpd: schedule the sending of label messages when necessaryRenato Westphal
Once we send a Label Withdraw, we can't send a Label Mapping for the same FEC until we receive a Label Release from the peer. This is due to some limitations in the LDP algorithms described in Appendix A. ("LDP Label Distribution Procedures") of RFC 5036. To workaround this issue, make it possible to schedule the sending of a Label Mapping as soon as a Label Release is received for the same FEC. The easiest way to test this patch is by typing the "label local advertise explicit-null" command. ldpd will withdraw all null labels using a Wildcard FEC and then send new Label Mappings as soon the corresponding Label Releases are received. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-26ldpd: use synchronous channels for sending log messagesRenato Westphal
This is necessary to guarantee that all log messages sent from the child processes are received in the parent process right away. Without this patch, when a child process calls fatal() or fatalx(), the log messages don't make it to the parent because the child doesn't have a chance to flush its buffers before exiting. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-26ldpd: simplify initialization of the child processesRenato Westphal
In order to have separate ASLR/cookies per process, ldpd calls exec() in the child processes after fork() (this is also known as the fork+exec model). This is an important security feature but it makes the initialization of the child processes a bit more complicated as they're not a copy of the parent anymore, so all parameters given via command line are lost. To solve this problem, we were creating an argv array by hand with all necessary parameters and providing it to the exec() syscall. This works but it's a very ugly solution. This patch introduces a different approach to solve the problem: send an IMSG_INIT message to the child processes with all parameters they need in order to initialize properly. This makes adding additional initialization parameters much more convenient and less error prone. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31ldpd: fix configuration of non-existing VPLS interfaces and pseudowiresRenato Westphal
If we don't know the ifindex, flags, etc of an interface at the time it's configured, we should make sure that once this information is available the appropriate structures are updated. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31ldpd: no need to synchronize pseudowires with LSPs anymoreRenato Westphal
Since commit 595b4be, the l2vpn_pw_ok() function doesn't check if there's a working LSP to the remote end of the pseudowire (we assume that zebra will do that for us). With that said, the l2vpn_sync_pws() function is not necessary anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-27ldpd: fix pseudowire merge algorithmRenato Westphal
The previous algorithm wasn't failsafe for full configuration reloads where several pseudowires can be inserted or removed at the same time. This patch introduces a much simpler logic that solves the problem in a better way. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-27ldpd: remove a few unnecessary functionsRenato Westphal
The original ldpd(8) daemon in OpenBSD doesn't allow the user to put non-existing interfaces in the configuration file. For this reason, the l2vpn_if_find() and l2vpn_pw_find() functions take an ifindex as an argument. In FRR's ldpd we can put non-existing interfaces in the configuration, and they are activated as soon as they are available. For this reason, we can't lookup interfaces by their ifindex in this port. The l2vpn_if_find_name() and l2vpn_pw_find_name() functions were introduced to address this issue. However, since the "find-by-ifindex" functions are not being used anymore, we can just remove them and rename the *_find_name() functions removing the "_name" suffix. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-20Implement generic label managerßingen
Label Manager allows to share MPLS label space among different daemons. Each daemon can request a chunk of consecutive labels and release it if it doesn't need them anymore. Label Manager stores the daemon protocol and instance to identify the owner client. It uses them to perform garbage collection, releasing all label chunks from a client when it gets disconnected or reconnected. Additionally, every client can request that the chunk is never garbage collected. In that case client has the responsibility to release non-used labels. Zebra can host the label manager itself (if no -l param is provided) or connect to an external one using zserv/zclient (providing its address with -l param). Client code is in lib/zclient.c, but currently only LDP is using it. TODO: Allow for custom ranges requests, i.e., specify the start label besides the chunk. TODO: Release labels from LDP. Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>
2017-03-03ldpd: send VPLS MAC withdrawalsRenato Westphal
RFC 4762 says that MAC address withdrawal messages can be used to improve convergence time in VPLS networks. This patch makes ldpd send MAC withdrawals whenever a non-pseudowire interface pertaining to a VPLS goes down. The processing of received MAC withdrawals will be implemented later. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03ldpd: implement RFC 5919 (LDP End-of-LIB)Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03ldpd: implement RFC 6667 (Typed Wildcard FEC for PWid)Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03ldpd: implement RFC 5918 (Typed Wildcard FEC)Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03ldpd: implement support for PWid group wildcardsRenato Westphal
This was missing from our original RFC 4447 VPLS implementation. Now ldpd understands group wildcards as mandated by the RFC, but we still don't send them ourselves. I can't see any case in which sending a group wildcard would be useful, but nonetheless this patch provides a function called lde_send_labelwithdraw_pwid_wcard() which is ready to be used in the future anytime we feel like it might be useful. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03ldpd: minor tweaksRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-06ldpd: update local labels when necessaryRenato Westphal
ldpd allocates null labels for directly connected routes. If a connected route is removed (interface goes down) and an IGP learned route takes its place in the RIB, ldpd must update the local label of the associated FEC entry with a non-null label. The same applies for the other way around (an interface goes up and a connected route is selected in favour of an IGP route). Labels should be dynamic and change when necessary. Additionally, this patch fixes the processing of route delete messages from zebra. Route delete messages don't contain any nexthop, meaning that whenever we receive such messages we must delete all nexthop previously received. Based on a patch from Bingen Eguzkitza <bingen@voltanet.io>. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-01ldpd: introduce advanced filtering capabilitiesRenato Westphal
This patch introduces several new configuration commands to ldpd. These commands should allow the operator to define advanced filtering policies for things like label advertisement, label allocation, etc. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03ldpd: use red-black trees to store 'lde_map' elementsRenato Westphal
Using red-black trees instead of linked lists brings the following benefits: 1 - Elements are naturally ordered (no need to reorder anything before outputting data to the user); 2 - Faster lookups/deletes: O(log n) time complexity against O(n). The insert operation with red-black trees is more expensive though, but that's not a big issue since lookups are much more frequent. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-12-14zebra/ldpd: allow MPLS ECMP on unnumbered interfacesRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org> (cherry picked from commit 7144dc12b55e05c9ae3d784dfb75817c9f881eb6)
2016-09-28ldpd: fix processing of redistributed routesRenato Westphal
Commit 5048fe changed the way zebra behave when a route is updated. Now, whenever a route is changed, zebra advertises its new version without withdrawing the old one. This patch adapts ldpd to understand this new behavior. After processing a ZEBRA_REDISTRIBUTE_IPV[46]_ADD message, we need to check for nexthops that were removed and, for each of them (if any), withdraw the associated labels from zebra. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23ldpd: adapt the code for QuaggaRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23ldpd: copy original sources from OpenBSD (14/09/2016)Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>