summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.c
AgeCommit message (Collapse)Author
2024-05-18zebra: fix mpls commandanlan_cs
Configured with "mpls label bind 1.1.1.1/32 explicit-null", the running configuration is: ``` ! mpls label bind 1.1.1.1/32 IPv4 Explicit Null ! ``` After this commit, the running configuration is: ``` ! mpls label bind 1.1.1.1/32 explicit-null ! ``` And add the support for the "no" form: ``` anlan(config)# mpls label bind 1.1.1.1/32 explicit-null anlan(config)# no mpls label bind 1.1.1.1/32 explicit-null ``` Signed-off-by: anlan_cs <anlan_cs@tom.com> (cherry picked from commit 05ad3ccb034c174d2e853e88b826ca0db1e77f45)
2023-12-05Merge pull request #12600 from donaldsharp/local_routesRuss White
*: Introduce Local Host Routes to FRR
2023-11-21zebra: Unregister mpls hooks on zebra shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-17zebra: reduce number of switch statements with dplane opcodesMark Stapp
Replace several switch blocks that contain every dplane opcode with simpler sets of if()s. In these cases the code only uses a couple of opcodes. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-11-01*: Introduce Local Host Routes to FRRDonald Sharp
Create Local routes in FRR: S 0.0.0.0/0 [1/0] via 192.168.119.1, enp39s0, weight 1, 00:03:46 K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:03:51 O 192.168.119.0/24 [110/100] is directly connected, enp39s0, weight 1, 00:03:46 C>* 192.168.119.0/24 is directly connected, enp39s0, 00:03:51 L>* 192.168.119.224/32 is directly connected, enp39s0, 00:03:51 O 192.168.119.229/32 [110/100] via 0.0.0.0, enp39s0 inactive, weight 1, 00:03:46 C>* 192.168.119.229/32 is directly connected, enp39s0, 00:03:46 Create ability to redistribute local routes. Modify tests to support this change. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-10-12build: add -Wimplicit-fallthroughIgor Ryzhov
Also: - replace all /* fallthrough */ comments with portable fallthrough; pseudo keyword to accomodate both gcc and clang - add missing break; statements as required by older versions of gcc - cleanup some code to remove unnecessary fallthrough Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-07-12zebra: remove unnecessary check for default vrfanlan_cs
The default vrf is generally non-NULL, except when shutdown. So, most of the time it is not necessary to check if it is NULL, we should remove the useless checks for it. Searched them with exact match: ``` grep -rI "zebra_vrf_lookup_by_id(VRF_DEFAULT)" | wc -l 31 ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-07-05zebra: Add code to get/set interface to pass up from dplaneDonald Sharp
1) Add a bunch of get/set functions and associated data structure in zebra_dplane to allow the setting and retrieval of interface netlink data up into the master pthread. 2) Add a bit of code to breakup startup into stages. This is because FRR currently has a mix of dplane and non dplane interactions and the code needs to be paused before continuing on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-09zebra: mpls nexthop entry displays also interface when availablePhilippe Guibert
The 'show mpls table json' command displays the outgoing interface name only when the nexthop type is either NEXTHOP_TYPE_IFINDEX or NEXTHOP_TYPE_IPV6_IFINDEX. add the interface name for the nexthop type NEXTHOP_TYPE_IPV4_IFINDEX. Fixes: ("b78b820d46d6") MPLS: Display enhancements and JSON support Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-09zebra: handle nexthop vrf_id in ZEBRA_MPLS_LABELS messagesPhilippe Guibert
This commit addresses the case where a service wants to install an LSP entry to a next-hop located in a VRF instance. The incoming MPLS packet is on the namespace and has to be directed to a nexthop located behind an interface that sits in a specific VRF instance. The below iproute command can illustrate: > ip link add vrf1 type vrf table 10 > ip link set dev vrf1 up > ip link set dev eth0 master vrf1 > ip a a 192.0.2.1/24 dev eth0 > ip -f mpls route add 105 via inet 192.0.2.45 dev eth0 If a service uses the ZEBRA_MPLS_LABELS messages, then the LSP message is ignored: from zebra perspective, the MPLS entries are visible via the 'show mpls table' command, but no LSP entry is installed in the kernel. The issue is in the nhlfe_nexthop_active_ipv[4/6] function: the outgoing interface mentioned in the nexthop is searched in the main VRF, whereas the interface is in a separate VRF. The interface is not found, and the nhlfe to install is considered not active. To address this issue, reuse the incoming vrf_id parameter transmitted in the nexthop structure from the ZEBRA_MPLS_LABELS message. When creating an NHLFE entry, the vrf_id is used instead of the DEFAULT_VRF. And the nhlfe entry can be considered as active. One alternate solution to reuse the vrf_id parameter in the mpls network context would be to modify the search function in nhlfe_nexthop_active..() function: looking for an existing ifindex in the zns. However, this solution may not fit later when netns backend would be used. Note that some changes have not been done yet and are considered sufficient for now: - The 'nhlfe_find' API: the assumption is done that only the linux vrf backend is used for now. - The 'mpls_lsp_install()' API: It is currently used by the CLI command which does not handle the interface parameter, and the SRTE service, whih always sends LSPs towards a nexthop located in the VRF_DEFAULT. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-09zebra: accept LSP entries with an mpls-less outgoing interfacePhilippe Guibert
The ZEBRA_MPLS_LABELS_[ADD/DELETE/REPLACE] messages may change an LSP entry based on an incoming MPLS entry, followed by a given next-hop. Having a next hop with no label information inside is rejected by the zebra layer. As illustration, the following ZAPI message would be rejected, because the next hop does not contain any label information. > ip -f mpls route add 105 via inet 192.0.2.45 At the same time, such configuration is desirable to be supported: An attempt has been done to configure the next-hop with an implicit- null label. But the message is rejected by the kernel: > ip -f mpls route add 104 as 3 via inet 192.0.2.45 > Error: Implicit NULL Label (3) can not be used in encapsulation. The commit proposes to accept ZEBRA_MPLS_LABELS_[XX] messages with a nexthop that does not contain any label information. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-03Revert "MPLS allocation mode per next hop"Donatas Abraitis
Broken tests, let's revert now. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-02Merge pull request #12646 from pguibert6WIND/mpls_alloc_per_nhDonatas Abraitis
MPLS allocation mode per next hop
2023-03-28zebra: Use zebra_vrf_lookup_by_id when we canDonald Sharp
Let's make this as consistent as is possible. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-22zebra: mpls nexthop entry displays also interface when availablePhilippe Guibert
The 'show mpls table json' command displays the outgoing interface name only when the nexthop type is either NEXTHOP_TYPE_IFINDEX or NEXTHOP_TYPE_IPV6_IFINDEX. add the interface name for the nexthop type NEXTHOP_TYPE_IPV4_IFINDEX. Fixes: ("b78b820d46d6") MPLS: Display enhancements and JSON support Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-22zebra: handle nexthop vrf_id in ZEBRA_MPLS_LABELS messagesPhilippe Guibert
This commit addresses the case where a service wants to install an LSP entry to a next-hop located in a VRF instance. The incoming MPLS packet is on the namespace and has to be directed to a nexthop located behind an interface that sits in a specific VRF instance. The below iproute command can illustrate: > ip link add vrf1 type vrf table 10 > ip link set dev vrf1 up > ip link set dev eth0 master vrf1 > ip a a 192.0.2.1/24 dev eth0 > ip -f mpls route add 105 via inet 192.0.2.45 dev eth0 If a service uses the ZEBRA_MPLS_LABELS messages, then the LSP message is ignored: from zebra perspective, the MPLS entries are visible via the 'show mpls table' command, but no LSP entry is installed in the kernel. The issue is in the nhlfe_nexthop_active_ipv[4/6] function: the outgoing interface mentioned in the nexthop is searched in the main VRF, whereas the interface is in a separate VRF. The interface is not found, and the nhlfe to install is considered not active. To address this issue, reuse the incoming vrf_id parameter transmitted in the nexthop structure from the ZEBRA_MPLS_LABELS message. When creating an NHLFE entry, the vrf_id is used instead of the DEFAULT_VRF. And the nhlfe entry can be considered as active. One alternate solution to reuse the vrf_id parameter in the mpls network context would be to modify the search function in nhlfe_nexthop_active..() function: looking for an existing ifindex in the zns. However, this solution may not fit later when netns backend would be used. Note that some changes have not been done yet and are considered sufficient for now: - The 'nhlfe_find' API: the assumption is done that only the linux vrf backend is used for now. - The 'mpls_lsp_install()' API: It is currently used by the CLI command which does not handle the interface parameter, and the SRTE service, whih always sends LSPs towards a nexthop located in the VRF_DEFAULT. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-22zebra: accept LSP entries with an mpls-less outgoing interfacePhilippe Guibert
The ZEBRA_MPLS_LABELS_[ADD/DELETE/REPLACE] messages may change an LSP entry based on an incoming MPLS entry, followed by a given next-hop. Having a next hop with no label information inside is rejected by the zebra layer. As illustration, the following ZAPI message would be rejected, because the next hop does not contain any label information. > ip -f mpls route add 105 via inet 192.0.2.45 At the same time, such configuration is desirable to be supported: An attempt has been done to configure the next-hop with an implicit- null label. But the message is rejected by the kernel: > ip -f mpls route add 104 as 3 via inet 192.0.2.45 > Error: Implicit NULL Label (3) can not be used in encapsulation. The commit proposes to accept ZEBRA_MPLS_LABELS_[XX] messages with a nexthop that does not contain any label information. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-21*: Add a hash_clean_and_free() functionDonald Sharp
Add a hash_clean_and_free() function as well as convert the code to use it. This function also takes a double pointer to the hash to set it NULL. Also it cleanly does nothing if the pointer is NULL( as a bunch of code tested for ). Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-09zebra: add json support when "show zebra mpls" returns nothingPhilippe Guibert
The "show zebra mpls .. json" vty command may return empty information in case the MPLS database is empty or a given label entry is not available. When those errors occur, add the braces to return a valid json format. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-13lib,zebra,bgpd,staticd: use label code to store VNI infoStephen Worley
Use the already existing mpls label code to store VNI info for vxlan. VNI's are defined as labels just like mpls, we should be using the same code for both. This patch is the first part of that. Next we will need to abstract the label code to not be so mpls specific. Currently in this, we are just treating VXLAN as a label type and storing it that way. Signed-off-by: Stephen Worley <sworley@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>
2023-01-31zebra: Add missing enums to switch statementsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-15lib, tests, zebra: Remove unused workqueue error functionDonald Sharp
The wq->spec.errorfunc is never used in the code. It's been in the code base since 2005 and I also do not remember ever seeing it being called. No workqueue process function ever returns error. Since it's not used let's just remove it from the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-17zebra: Convert label processing to Meta-QDonald Sharp
Convert label processing that comes from zapi messages into being handled by the meta-Q. This is because early route processing is going to be moved to the meta-Q as well and we will have a chicken and egg problem without moving this code to be processed by the meta-Q. Ordering of messages from ospf as an example: 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:62] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:43] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:61] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:66] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36] 2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36] The ZEBRA_MPLS_LABELS_REPLACE immediately turn around and attempt to replace nexthop labels on routes that were added. If the route add is placed on the metaQ, it will not exist yet and as such the label replace will fail. Modify the zebra code to take the label operations and place them on the metaQ as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-10zebra: Remove unused return codes in zebra_mpls.cDonald Sharp
There are some return codes for functions that are not really used. Clean them up. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08zebra: Notice when an interface is turned on w/ mpls and enable mpls subsystemDonald Sharp
Currently when FRR starts up it queries the kernel to see if mpls is turned on. If not FRR does not enable zebra's mpls subsection. If at a later time mpls is turned on, let's notice that an interface now is enabled for mpls( thus implying that all the bits and bobs in the kernel are now setup properly ). a) convert mpls_enabled to a bool b) abstract a new function zebra_mpls_turned_on and call it when FRR notices that an interface now has mpls enabled. c) mpls_processq_init cannot fail, so actually notice that and don't have special code to detect a failure. New results: sharpd@eva ~> vtysh -c "show zebra" OS Linux(5.10.0-12-amd64) ECMP Maximum 128 v4 Forwarding On v6 Forwarding On MPLS Off EVPN Off Kernel socket buffer size 90000000 VRF l3mdev Available ASIC offload Unavailable RA Compiled in RFC 5549 BGP is not using Kernel NHG Available v4 All LinkDown Routes Off v4 Default LinkDown Routes Off v6 All LinkDown Routes Off v6 Default LinkDown Routes Off v4 All MC Forwarding On v4 Default MC Forwarding Off v6 All MC Forwarding On v6 Default MC Forwarding Off Route Route Neighbor LSP LSP VRF Installs Removals Updates Installs Removals default 26 7 0 0 0 <turn on mpls_iptunnel and mpls_router modules in the kernel and then do this>: sharpd@eva ~> sudo sysctl -w net.mpls.conf.enp39s0.input=1 [sudo] password for sharpd: net.mpls.conf.enp39s0.input = 1 sharpd@eva ~> vtysh -c "show zebra" OS Linux(5.10.0-12-amd64) ECMP Maximum 128 v4 Forwarding On v6 Forwarding On MPLS On EVPN Off Kernel socket buffer size 90000000 VRF l3mdev Available ASIC offload Unavailable RA Compiled in RFC 5549 BGP is not using Kernel NHG Available v4 All LinkDown Routes Off v4 Default LinkDown Routes Off v6 All LinkDown Routes Off v6 Default LinkDown Routes Off v4 All MC Forwarding On v4 Default MC Forwarding Off v6 All MC Forwarding On v6 Default MC Forwarding Off Route Route Neighbor LSP LSP VRF Installs Removals Updates Installs Removals default 26 7 0 0 0 sharpd@eva ~> I am doing this work because FRR keeps having operators not know about how to properly use mpls. Let's make FRR behave a bit better in this weird edge case. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-05zebra: zrouter.in_shutdown is an atomic variableDonald Sharp
So let's treat the variable like it is atomic and properly load it when we need to look at it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-26zebra: Fix lost memory on lsp freeDonald Sharp
When cleaning up memory associated with a lsp the nhlfe is lost in some cases. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-18zebra: Cleanup the memory from the hash for MPLS stuffDonatas Abraitis
==1595641== 280 (80 direct, 200 indirect) bytes in 1 blocks are definitely lost in loss record 30 of 38 ==1595641== at 0x483AB65: calloc (vg_replace_malloc.c:760) ==1595641== by 0x493C89C: qcalloc (memory.c:116) ==1595641== by 0x1E8426: lsp_alloc (zebra_mpls.c:1116) ==1595641== by 0x49147F1: hash_get (hash.c:162) ==1595641== by 0x1EC880: mpls_lsp_install (zebra_mpls.c:3192) ==1595641== by 0x1C51BB: zread_vrf_label (zapi_msg.c:3197) ==1595641== by 0x1C6F11: zserv_handle_commands (zapi_msg.c:3863) ==1595641== by 0x24D0F4: zserv_process_messages (zserv.c:523) ==1595641== by 0x498F4CC: thread_call (thread.c:2002) ==1595641== by 0x49253A2: frr_run (libfrr.c:1198) ==1595641== by 0x1A28BA: main (main.c:475) ==1595641== ==1595641== 1,400 (400 direct, 1,000 indirect) bytes in 5 blocks are definitely lost in loss record 35 of 38 ==1595641== at 0x483AB65: calloc (vg_replace_malloc.c:760) ==1595641== by 0x493C89C: qcalloc (memory.c:116) ==1595641== by 0x1E8426: lsp_alloc (zebra_mpls.c:1116) ==1595641== by 0x49147F1: hash_get (hash.c:162) ==1595641== by 0x1EBD7C: mpls_zapi_labels_process (zebra_mpls.c:2915) ==1595641== by 0x1C35D9: zread_mpls_labels_add (zapi_msg.c:2513) ==1595641== by 0x1C6F11: zserv_handle_commands (zapi_msg.c:3863) ==1595641== by 0x24D0F4: zserv_process_messages (zserv.c:523) ==1595641== by 0x498F4CC: thread_call (thread.c:2002) ==1595641== by 0x49253A2: frr_run (libfrr.c:1198) ==1595641== by 0x1A28BA: main (main.c:475) Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-29zebra: make rib_process_dplane_results own ctx freeingDonald Sharp
The rib_process_dplane_results function was having each sub function handler process the results and then free the ctx. Lot's of functionality that needs to remember to free the context. Let's just free it in the main loop. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-03*: remove the checking returned value for hash_get()anlan_cs
Firstly, *keep no change* for `hash_get()` with NULL `alloc_func`. Only focus on cases with non-NULL `alloc_func` of `hash_get()`. Since `hash_get()` with non-NULL `alloc_func` parameter shall not fail, just ignore the returned value of it. The returned value must not be NULL. So in this case, remove the unnecessary checking NULL or not for the returned value and add `void` in front of it. Importantly, also *keep no change* for the two cases with non-NULL `alloc_func` - 1) Use `assert(<returned_data> == <searching_data>)` to ensure it is a created node, not a found node. Refer to `isis_vertex_queue_insert()` of isisd, there are many examples of this case in isid. 2) Use `<returned_data> != <searching_data>` to judge it is a found node, then free <searching_data>. Refer to `aspath_intern()` of bgpd, there are many examples of this case in bgpd. Here, <returned_data> is the returned value from `hash_get()`, and <searching_data> is the data, which is to be put into hash table. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2021-11-25zebra: Convert vty_out to vty_json for JSONDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18Merge pull request #10092 from ↵Igor Ryzhov
ton31337/feature/replace_json_object_string_add_to_json_object_string_addf_for_inet_ntop *: inet_ntop for JSON output
2021-11-18*: Remove unused variablesDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18zebra: Replace inet_ntop to %pI4/6 for JSON outputsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18zebra: during shutdown, don't process LSPs on the lsp workqueueMark Stapp
During zebra shutdown, we clear out the LSP workqueue. The LSPs will be uninstalled and freed during the shutdown process, so just ignore any LSPs that happen to be on the workqueue. Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_fec` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_lsp` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_nhlfe` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_ile` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-08-12zebra: mpls validation and static lsp fixesMark Stapp
Handle TYPE_IFINDEX nexthops more consistently in a few places; be more specific about a few integer return values that were being treated as booleans. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
2021-08-04zebra: prevent crash when nhlfe is NULLDonald Sharp
There exists a call path where the nhlfe_alloc can return NULL for blackhole nexthops. In this case we were still trying to save the nhlfe pointer causing a crash when we attempted to add it to a self-contained list. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-08-04zebra: don't use default case when switching over enum nexthopDonald Sharp
Do not use the `default` case when switching over an enumerated type. This allows the code to fail to compile when we add a new enumeration. Thus allowing us developers to know all the places in the code we'll need to touch. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-21zebra: On client shutdown cleanup any vrf labels associated with itDonald Sharp
When a vrf label is created by a client and the client disconnects we should clean up any vrf labels associated with that client. eva# show mpls table Inbound Label Type Nexthop Outbound Label ----------------------------------------------- 1000 SHARP RED - eva# exit sharpd@eva ~/f/zebra (label_destruction)> ps -ef | grep frr root 4017793 1 0 13:57 ? 00:00:00 /usr/lib/frr/watchfrr -d -F datacenter --log file:/var/log/frr/watchfrr.log --log-level debug zebra bgpd ospfd isisd pimd eigrpd sharpd staticd frr 4017824 1 0 13:57 ? 00:00:00 /usr/lib/frr/zebra -d -F datacenter --log file:/tmp/zebra.log -r --graceful_restart 60 -A 127.0.0.1 -s 90000000 frr 4017829 1 0 13:57 ? 00:00:00 /usr/lib/frr/bgpd -d -F datacenter -M rpki -A 127.0.0.1 frr 4017836 1 0 13:57 ? 00:00:00 /usr/lib/frr/ospfd -d -F datacenter -A 127.0.0.1 frr 4017839 1 0 13:57 ? 00:00:00 /usr/lib/frr/isisd -d -F datacenter -A 127.0.0.1 frr 4017842 1 0 13:57 ? 00:00:00 /usr/lib/frr/pimd -d -F datacenter -A 127.0.0.1 frr 4017865 1 0 13:57 ? 00:00:00 /usr/lib/frr/eigrpd -d -F datacenter -A 127.0.0.1 frr 4017869 1 0 13:57 ? 00:00:00 /usr/lib/frr/sharpd -d -F datacenter -A 127.0.0.1 frr 4017888 1 0 13:57 ? 00:00:00 /usr/lib/frr/staticd -d -F datacenter -A 127.0.0.1 sharpd 4018624 3938423 0 14:02 pts/10 00:00:00 grep --color=auto frr sharpd@eva ~/f/zebra (label_destruction)> sudo kill -9 4017869 sharpd@eva ~/f/zebra (label_destruction)> sudo vtysh -c "show mpls table" sharpd@eva ~/f/zebra (label_destruction)> Fixes: #1787 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-01*: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLENDonatas Abraitis
Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-01*: Replace IPV6_MAX_PREFIXLEN to IPV6_MAX_BITLENDonatas Abraitis
Just drop IPV6_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>