summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-01-16Merge pull request #5674 from qlyoung/fix-zebra-redist-disconnect-memleakDavid Lamparter
zebra: fix redist memleak on client disconnect
2020-01-15Merge pull request #5600 from sworleys/NHG-Depend-CrashMark Stapp
zebra: can't improve efficiency for recursive depends
2020-01-15zebra: fix redist memleak on client disconnectQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-15lib: assert if someone adds to nexthop list to nhgStephen Worley
If someone tries to add a nexthop with a list of nexthops already attached to it, let's just assert. This standardizes the API to say we assume this is an individual nexthop you are appending to a group. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-15lib,zebra: tighten up the nexthop_copy/nexthop_dup APIsStephen Worley
Make the nexthop_copy/nexthop_dup APIs more consistent by adding a secondary, non-recursive, version of them. Before, it was inconsistent whether the APIs were expected to copy recursive info or not. Make it clear now that the default is recursive info is copied unless the _no_recurse() version is called. These APIs are not heavily used so it is fine to change them for now. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-08lib,zebra: add zapi msg top level error handlingStephen Worley
Add error handling for top level failures (not able to execute command, unable to find vrf for command, etc.) With this error handling we add a new zapi message type of ZEBRA_ERROR used when we are unable to properly handle a zapi command and pass it down into the lower level code. In the event of this, we reply with a message of type enum zebra_error_types containing the error type. The sent packet will look like so: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Marker | Version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VRF ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Command | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ERROR TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Also add appropriate hooks for clients to subscribe to for handling these types of errors. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-07Merge pull request #5314 from qlyoung/yang-vrrpRenato Westphal
VRRP northbound conversion
2020-01-06Merge pull request #5621 from qlyoung/fix-zclient-excess-nexthop-decodeMark Stapp
lib: dont decode more nexthops than we can handle
2020-01-06lib: dont decode more nexthops than we can handleQuentin Young
If someone provides us more nexthops than our configured multipath setting, drop the rest of them Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-03lib: fix ifindex comparison overflowQuentin Young
Very small (negative!) ifindexes, when subtracted, can overflow. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-22Merge pull request #5268 from qlyoung/vrrp-vrfDonatas Abraitis
VRRP VRF support
2019-12-19lib: fix build of the northbound pluginsRenato Westphal
Commit 1b3e9a21dd4 removed the global visibility of the yang_modules variable, breaking the build of all northbound plugins. Revert a small part of that commit to fix this issue. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-12-18lib: document vrf_socket(), vrf_bind()Quentin Young
These two don't really do what you might expect, document them Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-16lib: default nexthop weights to oneStephen Worley
Default all nexthop weights to one. The linux kernel does some weird stuff where it adds one to all nexthop weight values it gets. So, we added df7fb5800b3798057747873c8be245eb13f3ec36 with some special subtracing/adding to account for this. Though, that patch did not account for the default case of the weight being zero for elements in the group. Hence, this patch defaults the nexthop weight to one during creation. This should be a valid value on all platforms anyway so shouldn't affect anything. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-16Merge pull request #5535 from opensourcerouting/santa-elfDonald Sharp
*: cleanup elves were here
2019-12-14lib/linklist: flip the bitrot compostDavid Lamparter
The whole lib/linklist.c code shouldn't really be used for new code (the lib/typesafe.h bits are better.) So, a new need for these unused functions shouldn't be coming up. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14lib: random unused bits cleanupDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14lib/prefix: flip the bitrot compostDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-13Merge pull request #5452 from mjstapp/fix_notify_nhgDonald Sharp
zebra: align dplane notify processing with nhg work
2019-12-13lib: make some variables staticDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-13lib: completely get rid of the MTYPE alias hackDavid Lamparter
Sometimes the easiest solution is hardest to find... the whole point of all this "static const", aliasing, & co. was to make "MTYPE_FOO" usable without adding the extra & as in "&MTYPE_FOO". Making it a size-1 array does that perfectly through the magic of ISO C array decay... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-13lib: make rcu_free() NULL-safeDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-12-11Merge pull request #5528 from opensourcerouting/bmp-dns-fixingDonald Sharp
BMP: improve active outbound connection details
2019-12-11Merge pull request #5497 from donaldsharp/unequality_ecmpMark Stapp
Unequality ecmp
2019-12-11lib,nhrpd,bgpd/bmp: pass resolver failure detailsDavid Lamparter
To keep the calling code agnostic of the DNS resolver libary used, pass a strerror-style string instead of a status code that would need extra handling. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11lib/resolver: support/bypass IP literalsDavid Lamparter
libc-ares doesn't do IP literals, so we have to do that before running off to do DNS. Since this isn't BMP specific, move to lib/ so NHRP can benefit too. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11lib/skiplist: fix gcc-9 used-uninitialized warningDavid Lamparter
Under some circumstances (apparently depends on several optimization flags), gcc-9 throws an used-uninitialized warning for this variable in the skiplist code. Just initialize to NULL. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-10lib: fixes invalid running_entry when VRF is changedMahdi Varasteh
we just unset the entry from old node and add it to the new one Signed-off-by: Mahdi Varasteh <mahdy.varasteh@gmail.com>
2019-12-09lib,zebra: add api to enforce nexthop sort order when copyingMark Stapp
Add an api that creates a copy of a list of nexthops and enforces the canonical sort ordering; consolidate some nhg code to avoid copy-and-paste. The zebra dplane uses that api when a plugin sets up a list of nexthops, ensuring that the plugin's list is ordered when it's processed in zebra. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-09lib: add ipaddr_isset()Quentin Young
Compare ip address against 0 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09vrrpd: northbound conversionQuentin Young
Convert VRRPD to use the northbound API. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09lib: Add weight to nexthop for nexthop-group nexthopsDonald Sharp
Add the ability to read in the weight of a nexthop and store/handle it appropriately nexthop-group BLUE nexthop 192.168.201.44 weight 33 nexthop 192.168.201.45 weight 66 nexthop 192.168.201.46 weight 99 Is appropriately read in and handled as appropriate. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-09lib, zebra: Allow for encode/decode of nexthop weight in pass downDonald Sharp
Add code to encode/decode the nexthop weight when we pass it down into zebra. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-09lib, zebra: Allow for installation of a weighted nexthopDonald Sharp
Linux has the idea of allowing a weight to be sent down as part of a nexthop group to allow the kernel to weight particular nexthop paths a bit more or less than others. See: http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html Allow for installation into the kernel using the weight attribute associated with the nexthop. This code is foundational in that it just sets up the ability to do this, we do not use it yet. Further commits will allow for the pass through of this data from upper level protocols. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-07Merge pull request #5498 from mjstapp/sharp_with_labelsDonald Sharp
lib,sharpd: support labelled nexthop-groups in sharpd
2019-12-06Merge pull request #4765 from opensourcerouting/defaults-v2Donald Sharp
lib/*: new config defaults system, v2
2019-12-06lib,sharpd: support labelled nexthop-groups in sharpdMark Stapp
Update sharpd's zapi client code to support labelled nexthops if they're present in a nexthop-group. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06Merge pull request #5332 from mjstapp/remove_zapi_label_flagDonald Sharp
*: revise zapi nexthop encoding
2019-12-06*: revise zapi nexthop encodingMark Stapp
Use a per-nexthop flag to indicate the presence of labels; add some utility zapi encode/decode apis for nexthops; use the zapi apis more consistently. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06lib: use const in several stream lib apisMark Stapp
Add some const to some stream apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06Merge pull request #5438 from sworleys/PBR-FixesRenato Westphal
pbrd: Assorted Fixes
2019-12-06Merge pull request #5439 from mjstapp/nhg_add_labelsRenato Westphal
lib: support labelled nexthops in nexthop_groups
2019-12-06ospfd: use new defaults mechanism (v2)David Lamparter
Some preprocessor constants converted to enums to make the names usable in the preprocessor. v2: better isolation between core and vty code to make future northbound conversion easier. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06bgpd: use new defaults system (v2)David Lamparter
This moves all the DFLT_BGP_* stuff over to the new defaults mechanism. bgp_timers_nondefault() added to get better file-scoping. v2: moved everything into bgp_vty.c so that the core BGP code is independent of the CLI-specific defaults. This should make the future northbound conversion easier. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib/defaults: add bool variable supportDavid Lamparter
(I hadn't initially added this because I thought it superfluous, but it kinda makes things nicer.) Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib: new defaults logicDavid Lamparter
Since we've been writing out "frr version" and "frr defaults" for about a year and a half now, we can now actually use them to manage defaults. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib: add frr_version_cmp()David Lamparter
This just compares 2 version strings. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib: rename memory_vty.c to lib_vty.cDavid Lamparter
And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06Merge pull request #5464 from qlyoung/fix-bgp-prefix-orf-heap-overflowDonatas Abraitis
lib: fix heap buf overflow when adding prefix orf
2019-12-04Merge pull request #5416 from mjstapp/re_nhe_pointerDonald Sharp
lib,zebra: use shared nexthop-group in route_entry