summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.c
AgeCommit message (Collapse)Author
2019-10-25zebra: Use nexthop/interface vrf, not the routesStephen Worley
When hashing/creating the NHE, use the nexthops vrf as its source of data. This is gotten directly from an interface and should not come from a route. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Create a new NHE if the mpls labels changeStephen Worley
We should create a new NHE if the mpls labels change since we hash on them. This adds the functonality to do that and decrement the refcnt on the old one. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Replace nexthop_group with pointer in route entryDonald Sharp
In the route_entry we are keeping a non pointer based nexthop group, switch the code to use a pointer for all operations here and ensure we create and delete the memory. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-18zebra: fix mpls ftn uninstallEmanuele Di Pascale
when a client disconnects, we iterate over the routing table to remove any label that originated from that client. However we were erroneously passing the route type to the function, while it was expecting the lsp type. As a result, for example, killing ldpd would not remove the ldp labels from the routes. Kudos to @rwestphal for pointing me to the source of the issue. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-09-13Merge pull request #4949 from opensourcerouting/mpls-zapi-improvementsOlivier Dugeon
MPLS zapi improvements
2019-09-10lib, zebra: add new MPLS zapi message with route replace semanticsRenato Westphal
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>
2019-09-06zebra: improve cleanup of MPLS labels when zclient disconnectsRenato Westphal
Use the zserv_client_close hook to cleanup all MPLS labels advertised by a zclient when it disconnects. We were doing this cleanup for ldpd only, but now we have other daemons that are MPLS aware, like ospfd (due to the new Segment Routing feature). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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-09-06zebra: add missing case statement in nhlfe2str()Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06zebra: improve the output of "show mpls table"Renato Westphal
Use the table generator to adjust the columns width according to the table's content. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-29zebra: strcat -> strlcatQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-28zebra: generate updates from notificationsMark Stapp
If an async notification changes a route that's current, generate an update to keep the kernel in sync. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-05-28zebra: mpls lsp async notificationsMark Stapp
Add LSP notification event type; add a handler for LSP notifs; dispatch to that handler. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-05-14lib: hashing functions should take const argumentsQuentin Young
It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-07zebra: remove vrf LSPs when vrf is deletedMark Stapp
Try to remove any LSPs associated with a vrf when the vrf is deleted. The vrf code was calling a helpful zebra_mpls api, but that api was basically a no-op for vrfs other than the default. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-02-25*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: Rename backet to bucketTim Bray
Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
2019-02-13zebra: Deletion of a lsp is not a failure eventDonald Sharp
FRR is reporting that a lsp deletion event as a failure in the log messsages. This will lead to confusion and lots of fun debugging. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31zebra: Remove `struct zebra_t`Donald Sharp
This structure is unused anymore and does not belong in zserv.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31zebra: Move lsp_process_q to zrouterDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31zebra: Move the master thread handler to the zrouter structureDonald Sharp
The master thread handler is really part of the zrouter structure. So let's move it over to that. Eventually zserv.h will only be used for zapi messages. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-22zebra: Fix compile issues introduced by recent commit on newer compilersDonald Sharp
We were using dplane_ctx_get_status(ctx) and assigning that value to zebra_dplane_status, not zebra_dplane_result( yeah what? ) Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-22zebra: openbsd LSP update codeMark Stapp
Finish the LSP update code for the async dataplane for the openbsd platform. Remove synch apis now that we've converted to the async code path. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-22zebra: remove use of sync LSP update apisMark Stapp
Remove the last use of the pre-dataplane LSP update apis; remove the stubs from the 'null' implementation file. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-22zebra: move LSP updates into dataplane subsystemMark Stapp
Start performing LSP updates through the async dataplane subsystem. This is plumbed through for linux/netlink. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-22zebra: add apis to add and delete NHLFEsMark Stapp
Add public versions of zebra apis that add NHLFEs to an LSP, and that free NHLFEs. The dataplane code needs to capture/copy NHLFEs in order to do async LSP programming. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-12-20bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP ↵Anton Degtyarev
labeled unicast This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made: * bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes. * bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed) * bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index * zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC. Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
2018-10-19*: Replace hash_cmp function return value to a boolDonald Sharp
The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-19zebra: Create zebra_dplane.c and .hMark Stapp
Add first sketchy 'dplane' files. Signed-off-by: Mark Stapp <mjs@voltanet.io> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06zebra: flog_warn conversionQuentin Young
Convert Zebra to user error subsystem. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-30bgpd/ospfd: make bgp and ospf json response a bit more consistentDon Slice
Problem reported that some bgp and ospf json commands did not return any json output at all if the bgp/ospf instance did not exist. Additionally, some bgp and ospf json commands did not return any json output if the instance existed but no neighbors were defined. This fix makes these commands more consistent in returning empty braces for json output and issue a message if not using json output. Additionally, made the flag "use_json" a bool to make it consistent since previously, it had been defined as an int, char, u_char, and bool at various places. Ticket: CM-21040 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-16Merge pull request #2846 from donaldsharp/backet_dataRuss White
Backet data
2018-08-15zebra: Trust backet->dataDonald Sharp
The backet->data cannot be NULL, no need to check for it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14zebra, lib: error references for zebraQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-11*: ALLOC calls cannot failDonald Sharp
There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-10zebra: mpls entry interface lookup adaptation for vrf backendPhilippe Guibert
The search algorithm for interface based on ifindex only is adapted to vrf netns based too. Only the default netns will be used to search the interface index. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-08Merge pull request #2292 from donaldsharp/fixup_sb_stuffRuss White
Fixup sb stuff
2018-05-30zebra: Add `enum dp_req_result` to lsp install/deletesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30zebra: Rename SOUTHBOUND_XXX to DP_XXXDonald Sharp
The SOUTHBOUND_XXX enum was named a bit poorly. Let's use a bit better name for what we are trying to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-29zebra: refactor zserv names, consolidate eventsQuentin Young
* Add centralized thread scheduling dispatchers for client threads and the main thread * Rename everything in zserv.c to stop using a combination of: - zebra_server_* - zebra_* - zserv_* Everything in zserv.c now begins with zserv_*. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-22zebra: cleanup for zapi_msg.c splitQuentin Young
* Rename client_connect and client_close hooks to zapi_client_connect and zapi_client_close * Remove some more unnecessary headers * Fix a copy-paste error in zapi_msg.[ch] header comments * Fix an inclusion comment in zserv.c Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-22zebra: use hooks for client lifecycle callbacksQuentin Young
zserv.c was using hardcoded callbacks to clean up various components when a client disconnected. Ergo zserv.c had to know about all these unrelated components that it should not care about. We have hooks now, let's use the proper thing instead. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18lib, zebra: Move label conversion strings to libDonald Sharp
The mpls_label2str and mpls_str2label functions should not be zebra exclusive functions. Move them to lib/mpls.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-16zebra: Apply label to all nexthops when neededDonald Sharp
The application of a label to a route entry needs to look at all non-recursive nexthops to be attached to instead of just the first one. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-12zebra: reorganize zserv, batch i/oQuentin Young
Group send and receive functions together, change handlers to take a message instead of looking at ->ibuf and ->obuf, allow zebra to read multiple packets off the wire at a time. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>