summaryrefslogtreecommitdiff
path: root/zebra/zebra_srte.c
AgeCommit message (Collapse)Author
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-11-18zebra: Fix use-after-free issue in srte cleanupCarmine Scarpitta
Currently, in `zebra_srte_client_close_cleanup` we use the `RB_FOREACH` macro to traverse the SR policies tree. We remove the SR policies within the loop. Removing elements from the tree and freeing them is not safe and causes a use-after-free crash whenever the `zebra_srte_client_close_cleanup` is called to perform cleanup. This commit replaces the `RB_FOREACH` macro with its variant `RB_FOREACH_SAFE`. Unlike `RB_FOREACH`, `RB_FOREACH_SAFE` permits both the removal of tree elements as well as freeing them from within the loop safely. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-19zebra: upon srte leave, flush sr policiesPhilippe Guibert
Upon srte leave, flush SR policies. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-12*: When matching against a nexthop send and process what it matched againstDonald Sharp
Currently the nexthop tracking code is only sending to the requestor what it was requested to match against. When the nexthop tracking code was simplified to not need an import check and a nexthop check in b8210849b8ac1abe2d5d9a5ab2459abfde65efa5 for bgpd. It was not noticed that a longer prefix could match but it would be seen as a match because FRR was not sending up both the resolved route prefix and the route FRR was asked to match against. This code change causes the nexthop tracking code to pass back up the matched requested route (so that the calling protocol can figure out which one it is being told about ) as well as the actual prefix that was matched to. Fixes: #10766 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27lib, zebra: Send safi for rnh resolutionDonald Sharp
Pass down the safi for when we need address resolution. At this point in time we are hard coding the safi to SAFI_UNICAST. Future commits will take advantage of this. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27zebra: Start carrying safi for rnh processingDonald Sharp
PIM is going to need to be able to send down the address it is trying to resolve in the multicast rib. We need a way to signal this to the end developer. Start the conversion by adding the ability to have a safi. But only allow SAFI_UNICAST at the moment. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27zebra: remove 'enum rnh_type' from systemDonald Sharp
This code is now dead code since there are not two nexthop resolution types. 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-06-18zebra: We already store the last command as part of zserv_writeDonald Sharp
when sending nexthop information. We do not need to reset the last_write_cmd since that is taken care of in the send routine. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-22zebra: kill zebra_memory.h, use MTYPE_STATICDavid Lamparter
This one also needed a bit of shuffling around, but MTYPE_RE is the only one left used across file boundaries now. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-08-07lib, zebra: Add SR-TE policy infrastructure to zebraSebastien Merle
For the sake of Segment Routing (SR) and Traffic Engineering (TE) Policies there's a need for additional infrastructure within zebra. The infrastructure in this PR is supposed to manage such policies in terms of installing binding SIDs and LSPs. Also it is capable of managing MPLS labels using the label manager, keeping track of nexthops (for resolving labels) and notifying interested parties about changes of a policy/LSP state. Further it enables a route map mechanism for BGP and SR-TE colors such that learned BGP routes can be mapped onto SR-TE Policies. This PR does not introduce any usable features by now, it is just infrastructure for other upcoming PRs which will introduce 'pathd', a new SR-TE daemon. Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Sebastien Merle <sebastien@netdef.org>