summaryrefslogtreecommitdiff
path: root/zebra/rt_socket.c
AgeCommit message (Collapse)Author
2018-09-13zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06zebra: fix includesQuentin Young
Add and remove error related includes as necessary. 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-14*: use frr_elevate_privs() (1/2: coccinelle)David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
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-14bgpd, lib, zebra: Convert LIB_ERR_PRIVILEGESDonald Sharp
For all the places we zlog_err about raising/lowering privileges, use zlog_ferr. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-24Merge pull request #2665 from chiragshah6/evpn_devRuss White
bgpd: support evpn nd ext community
2018-07-23zebra: clean up const use in bsd buildMark Stapp
Missed a bsd/routing socket change when enforcing use of const in some kernel-facing api calls. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-07-17bgpd: support evpn nd ext communityChirag Shah
EVPN ND ext community support NA flag R-bit, to have proxy ND. Set R-bit in EVPN NA if a given router is default gateway or there is a local router attached, which can be determine based on local neighbor entry. Implement BGP ext community attribute to generate and parse R-bit and pass along zebra to program neigh entry in kernel. Upon receiving MAC/IP update with community type 0x06 and sub_type 0x08, pass the R-bit to zebra to program neigh entry. Set NTF_ROUTER in neigh entry and inform kernel to do proxy NA for EVPN. Ref: https://tools.ietf.org/html/draft-ietf-bess-evpn-na-flags-01 Ticket:CM-21712, CM-21711 Reviewed By: Testing Done: Configure Local vni enabled L3 Gateway, which would act as router, checked show evpn arp-cache vni x ip <ip of svi> on originated and remote VTEPs. "Router" flag is set. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-11zebra, libs: use const prefix ptrs in apisMark Stapp
Add 'const' to prefix args to several zebra route update, redistribution, and route owner notification apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-06-12zebra: Fix compilation of bsdDonald Sharp
Actually return a value. Fixes: #2413 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30zebra: Add a result from dataplane requestDonald Sharp
Add a bit of code to allow return of data plane request messages. Add the ability to pass the result back to callers of kernel_route_rib. 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-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-09lib: Isolate nexthop_group functions to nexthop_group.cDonald Sharp
Also modify `struct route_entry` to use nexthop_groups. Move ALL_NEXTHOPS loop to nexthop_group.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-27zebra: ipv6 operations stick to namespacePhilippe Guibert
All ipv6 operations stick to namespace. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-24zebra: Modify southbound interface to pass `struct route_node`Donald Sharp
The route_node that we are working on is going to be interesting to the kernel_route_rib_pass_fail. So I am setting up the code to allow me to pass it. This will be done in a subsuquent commit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-22lib, zebra: Rename and place appropriately the label stackDonald Sharp
Fix and rename the label stack to be better named. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-11zebra: Add one-shot thread to recheck speedDonald Sharp
There are certain interfaces that when brought up and we receive the netlink notification about it, the speed of the interface is not set correctly. This creates a one-shot thread that will wait 15 seconds and then requery the speed and if it is different it will renotify the running daemons. The kernel should notify us on speed changes, unfortunately this is not done currently via a netlink message as you would think. As I understand it there is some in-fighting about the proper way to approach this issue and due to the way the kernel release cycle works we are a ways off from getting this fixed. This is a `hack` to make us work correctly while we wait for the true answer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-29zebra: Fix lsp add/del from kernel using SETFLAGDonald Sharp
Setup a interface such that the add/del of lsp's from the kernel can have a callback for success/failure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-29zebra: Implement call back for route install/delete success/failDonald Sharp
When a route is installed or deleted into the kernel allow a callback mechanism to handle the success/failure of the kernel call. This separation is to allow us to do these things: 1) In the future create a true pthread to handle route install/deletes. This way we can schedule these events in a smarter fashion 2) Allow us to use a common southbound api for route install and deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-16zebra: rt_socket.c should not use SET_FLAGDonald Sharp
The SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) is already taken care of in zebra_rib.c. There is no need for this to be handled by rt_socket.c. rt_netlink.c does not do a SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) for route installation. Please note it does do it for a mpls labeled route installation, which will be fixed in a future commit. Remove some dead code from 2002 as well. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12zebra: deduplicate nexthopsDavid Lamparter
There exists situations where it is possible to have duplicate nexthops passed from a higher level protocol into zebra. This code notices this duplication of nexthops and marks the duplicates as DUPLICATE so we don't attempt to install it into the kernel. This is important on *BSD as I understand it because passing duplicate nexthops will cause the route to be rejected. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30*: fix styleQuentin Young
Fixes style nits introduced by recent pull requests. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-28zebra: cleanup blackhole supportDavid Lamparter
blackhole support was horribly broken. cleanup by removing blackhole stuff from ZEBRA_FLAG_* introduces support for "prohibit" routes (Linux/netlink only) also clean up blackhole options on "ip route" vty commands. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-22zebra: increase maximum label stack depthRenato Westphal
* Bump MPLS_MAX_LABELS from 2 to 16; * Adjust the static_nh_label structure and the mpls_label2str() function; * On OpenBSD, print an error message when trying to push more than one label at once (kernel limitation). While here, add support for MPLSv6 FTNs in OpenBSD. This is not the full package. We still can't pop multiple labels at once, or do things like swap a label and push other ones. We'll address that in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-02Merge branch 'master' into PIM_VRFDonald Sharp
2017-07-31build: zebra: remove *_method Makefile hacksDavid Lamparter
replace with preprocessor checks in source files. Much simpler... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-24lib, pimd, zebra: Allow pim to set pimregX into appropriate vrfDonald Sharp
The pimregX devices when created by the kernel are put into the default vrf. When pim gets the callback that the device exists, check to see if it is a pimregX device and if so move it into the appropriate vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24zebra: Allow S,G lookup to use RTNL_FAMILY_IPMRDonald Sharp
This current implementation unfortunately must ask the kernel for all mroutes because vrf's do not have the ability to request a single mroute at this time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp
2017-07-12bgpd, zebra: Support for sticky MACsvivek
Implement support for sticky (static) MACs. This includes the following: - Recognize MAC is static (using NUD_NOARP flag) and inform BGP - Construct MAC mobility extended community for sticky MACs as per RFC 7432 section 15.2 - Inform to zebra that remote MAC is sticky, where appropriate - Install sticky MACs into the kernel with the right flag - Appropriate handling in route selection Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12zebra: MAC and Neighbor (ARP/ND) handlingvivek
Implement handling of MACs and Neighbors (ARP/ND entries) in zebra: - MAC and Neighbor database handlers - Read MACs and Neighbors from the kernel, when needed and create entries in zebra's MAC and Neighbor databases. - Handle add/update/delete notifications from the kernel for MACs and Neighbors and update zebra's database appropriately - Inform locally learnt MACs and Neighbors to client - Handle MACIP add/delete from client and install appriporiate entries into the kernel - Since Neighbor entries will be installed on an SVI, implement the needed mappings NOTE: kernel interface is only implemented for Linux/netlink Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12zebra: VNI and VTEP handlingvivek
Implement fundamental handling for VNIs and VTEPs: - Handle EVPN enable/disable by client (advertise-all-vni) - Create/update/delete VNIs based on VxLAN interface events and inform client - Handle VTEP add/delete from client and install into kernel - New debug command for VxLAN/EVPN - kernel interface (Linux/netlink only) Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-10Rename ALL_NEXTHOPS_RO to ALL_NEXTHOPSßingen
2017-06-28Allow for more than 1 NH recursion levelßingen
Before, only one level of recursive resolution was supported. Signed-off-by: ßingen <bingen@voltanet.io>
2017-06-21*: simplify log message lookupQuentin Young
log.c provides functionality for associating a constant (typically a protocol constant) with a string and finding the string given the constant. However this is highly delicate code that is extremely prone to stack overflows and off-by-one's due to requiring the developer to always remember to update the array size constant and to do so correctly which, as shown by example, is never a good idea.b The original goal of this code was to try to implement lookups in O(1) time without a linear search through the message array. Since this code is used 99% of the time for debugs, it's worth the 5-6 additional cmp's worst case if it means we avoid explitable bugs due to oversights... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-01zebra: Refactor 'struct rib' to be 'struct route_entry'Donald Sharp
The 'struct rib' data structure is missnamed. It really is a 'struct route_entry' as part of the 'struct route_node'. We have 1 'struct route_entry' per route src. As such 1 route node can have multiple route entries if multiple protocols attempt to install the same route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08*: get rid of zlog(*, LOG_LEVEL, ...)David Lamparter
Result of running the following Coccinelle patch + fixups: <<EOF /* long-forms: zlog(NULL, <level>, ...) * => zlog_level(...) */ @@ expression list args; @@ - zlog(NULL, LOG_DEBUG, args) + zlog_debug(args) @@ expression list args; @@ - zlog(NULL, LOG_NOTICE, args) + zlog_notice(args) @@ expression list args; @@ - zlog(NULL, LOG_INFO, args) + zlog_info(args) @@ expression list args; @@ - zlog(NULL, LOG_WARNING, args) + zlog_warn(args) @@ expression list args; @@ - zlog(NULL, LOG_ERR, args) + zlog_err(args) /* long-forms: zlog(base->log, <level>, ...) * => zlog_level(...) */ @@ expression base; expression list args; @@ - zlog(base->log, LOG_DEBUG, args) + zlog_debug(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_NOTICE, args) + zlog_notice(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_INFO, args) + zlog_info(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_WARNING, args) + zlog_warn(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_ERR, args) + zlog_err(args) EOF Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-30zebra: add srcdest support to ribChristian Franke
Add srcdest support to the zebra rib and to the kernel and redistribution interfaces. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-01-18zebra: Fix kernel_get_ipmr_sg_stats to return an valueDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-17zebra: Fix wrong return typeDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-17zebra: Allow the collection of sg stats on more platforms.Donald Sharp
The code to collect the sg stats was written for linux. Abstract the call to allow it to work on all platforms. I have not implemented the call for non-linux systems. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-11-15lib: replace strlcpy & strlcat with glibc versionsDavid Lamparter
It seems these two were at some point copied in from rsync; replace with more recent versions that will hopefully become available in glibc as well. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-10-18zebra: Fix route deletion on *BSDTimo Teräs
Fix for not handling RTM_CHANGE correctly. This patch change it to delete/add instead. Using RTM_CHANGE on kernels where it works is better, but is left as an exercise for developer who has access and will to fix it on *BSD. [ed note: collaboration with Martin Winter]
2016-10-18zebra: kernel interface simplificationTimo Teräs
[DL: picked out from: "atomic FIB updates"] This simplifies the OS-specific route update API into a single entry point, kernel_route_rib(), which dispatches the various operations internally. Signed-off-by: Timo Teräs <timo.teras@iki.fi>