summaryrefslogtreecommitdiff
path: root/ldpd/l2vpn.c
AgeCommit message (Collapse)Author
2023-06-01ldpd: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.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>
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-06-01ldpd: Relay data plane pseudowire status in LDP notificationKaren Schoener
Provide a way for the data plane to indicate pseudowire status (such as: not forwarding, AC failure). On a data plane pseudowire install failure, data plane sets the pseudowire status. Zebra relays the pseudowire status to LDP. LDP includes the pseudowire status in the LDP notification to the LDP peer. Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-05-11ldpd and Zebra: Expand existing debug commands.lynne
L2VPN PW are very hard to determine why they do not come up. The following fixes expand the existing show commands in ldp and zebra to display a reason why the PW is in the DOWN state and also display the labeled nexthop route selected to reach the PW peer. By adding this information it will provide the user some guidance on how to debug the PW issue. Also fixed an assert if labels were changed for a PW that is between directly connected peers. Signed-off-by: Lynne Morrison <lynne@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>
2018-09-17bgpd isisd ldpd lib: const drop fixes (SA)F. Aragon
Can be detected with e.g. ./configure CFLAGS=-Wcast-qual CC=clang Signed-off-by: F. Aragon <paco@voltanet.io>
2018-02-23*: Make assignment from RB_ROOT in while loop work betterDonald Sharp
Fix up the assignment of the variable = RB_ROOT inside of while loop patter we were using. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-29ldpd: add a few warning messages to aid in troubleshootingRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-11-29zebra, ldpd: fix display of pseudowire statusRenato Westphal
In some circumstances zebra and ldpd would display a pseudowire as UP when in reality it's not (example: MTU mismatch between the two ends). Fix this to avoid confusion. Reported-by: ßingen <bingen@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-11-17ldp: Fix bug configuring PWßingen
With non-targeted LDP receiving a PW label mapping before configuring the PW was causing the SET message to be sent before the ADD one, so Zebra PW manager wouldn't find the PW on first message reception. Signed-off-by: ßingen <bingen@voltanet.io>
2017-09-28ldpd: improve ordering of interfaces on user outputRenato Westphal
Before: debian# show mpls ldp interface AF Interface State Uptime Hello Timers ac ipv4 rt0-eth0 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth1 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth10 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth11 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth2 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth3 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth4 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth5 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth6 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth7 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth8 ACTIVE 00:00:05 5/15 1 ipv4 rt0-eth9 ACTIVE 00:00:05 5/15 1 After: debian# show mpls ldp interface AF Interface State Uptime Hello Timers ac ipv4 rt0-eth0 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth1 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth2 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth3 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth4 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth5 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth6 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth7 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth8 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth9 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth10 ACTIVE 00:00:14 5/15 1 ipv4 rt0-eth11 ACTIVE 00:00:14 5/15 1 Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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-06-16lib: improve the RB implementationRafael Zalamena
Switch the RB tree implementation completely to the new dlg@'s version that uses pre-declared functions instead of macros for tree functions. Original e-mail/diff: https://marc.info/?l=openbsd-tech&m=147087487111068&w=2 Pros: * Reduces the amount of code that the usage of those macros generate * Allows the compiler to do a better compile-time check job * Might have better i-cache utilization since the tree code is shared Con: * dlg@ benchmarks shows it has 'very slightly slower' insertions * imported RB_* code must adapt the following calls: RB_INIT(), RB_GENERATE(), RB_ROOT(), RB_EMPTY(), make compare functions use 'const' (if not already) and maybe others.
2017-05-01ldpd: respect link-detect configurationRenato Westphal
We shouldn't check the operational status of an interface in ldpd if it's configured with "no link-detect" in zebra. That's what all the other routing daemons do. 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-18ldpd: remove pseudowire LSP checkRenato Westphal
In order to bring a pseudowire up, we must make sure that there's at least one LSP available to its remote end (otherwise the labeled frames from the CEs wouldn't reach their destination). We were doing this check in ldpd, but doing so is very limiting because it doesn't consider other types of LSPs that might be available (static LSPs, RSVP-TE, SR, etc). Thus remove this check from the l2vpn_pw_ok() function. Later on we'll implement a pseudowire manager in zebra which will solve this problem in a much better way (including notifying ldpd about failures to install a pseudowire in the kernel/hardware). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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 6667 (Typed Wildcard FEC for PWid)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-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-01-03ldpd: use red-black trees to store 'l2vpn_pw' 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>
2017-01-03ldpd: use red-black trees to store 'l2vpn_if' 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>
2017-01-03ldpd: use red-black trees to store 'l2vpn' 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>
2017-01-03ldpd: use red-black trees to store 'tnbr' 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>
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-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>