summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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 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
2019-12-04lib,zebra: use nhg_hash_entry pointer in route_entryMark Stapp
Replace the existing list of nexthops (via a nexthop_group struct) in the route_entry with a direct pointer to zebra's new shared group (from zebra_nhg.h). This allows more direct access to that shared group and the info it carries. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-03lib: support labelled nexthops in nexthop_groupsMark Stapp
Add support for labelled nexthops in nexthop-group vtysh configuration. Also update the PBR doc where the cli is described. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-03lib: Add zapi_rule_notify_owner2str() functionStephen Worley
Add a function for converting the zapi_rule_notify_owner enum type to a string for ease of use. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-03lib: fix heap buf overflow when adding prefix orfQuentin Young
Don't lose your way Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-02Merge pull request #5444 from opensourcerouting/show-candidate-fixDonald Sharp
lib: fix display of candidate configurations
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-29lib: fix display of candidate configurationsRenato Westphal
Commit 5e6a9350c16 implemented an optimization where candidate configurations are validated only before being displayed. The validation is done only to create default child nodes (due to how libyang works) and any possible error is ignored (candidate configurations can be invalid/incomplete). The problem is that we were calling lyd_validate() only when the CLI "with-defaults" option was used. But some cli_show() callbacks assume that default nodes exist and can crash when displaying a candidate configuration that isn't validated. To fix this, call lyd_validate() before displaying candidate configuration even when "with-defaults" is not used (that was a micro-optimization that shouldn't have been done). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-11-30*: make frr_yang_module_info constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make all route_map_rule_cmd constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>