summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-04-09Merge pull request #4102 from opensourcerouting/sendbuf_recvbuf_privsQuentin Young
*: setting the socket send/recv buffer sizes doesn't need elevated privs
2019-04-08*: setting the socket send/recv buffer sizes doesn't need elevated privsRenato Westphal
The less code running under elevated privileges the better. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-04-06lib: Fixup IFF_OUT_LOG macro to make SA happyDonald Sharp
The IFF_OUT_LOG macro is using BUFSIZE, which is the sizeof(logbuf) but for some reason 8.0 clang SA is not happy with it. Just make it happy. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-05lib: Add hash function for nexthop groupsStephen Worley
Add a hash function to turn a nexthop group into a 32 bit unsigned hash key with jhash. We do not care to hash any recursively resolved nexthops, just the group. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-04-04Merge pull request #3548 from opensourcerouting/rip-vrfDonald Sharp
rip(ng)d: add VRF support
2019-04-04Merge pull request #4065 from mjstapp/fix_nexthop_compareQuentin Young
libs: nexthop comparison includes labels if present
2019-04-04Merge pull request #4080 from mjstapp/fix_nh_copy_constQuentin Young
libs: use const in copy_nexthops api
2019-04-04Merge pull request #4074 from qlyoung/remove-event-counterRenato Westphal
lib: remove event_counter.[ch]
2019-04-04libs: use const in copy_nexthops apiMark Stapp
Use const for the source arg to copy_nexthops(). Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-04Merge pull request #4072 from chiragshah6/evpn_dev2Lou Berger
lib,bgpd: do not register nexthop 0.0.0.0 to nht
2019-04-04Merge pull request #4073 from donaldsharp/undebug_me_or_notLou Berger
some cleanup across multiple daemons
2019-04-03lib, pbrd, zebra: Fix size_t type printf warnings on obscure platformsDonald Sharp
Use the correct printf formater for those obscure platforms that we build against. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-03lib: reduce exported var symbolsQuentin Young
Don't need these in our DSO tables Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-03lib: remove event_counter.[ch]Quentin Young
goodbye spooky code Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-03*: do not register nexthop 0.0.0.0 to nhtChirag Shah
Avoid tracking 0.0.0.0/32 nexthop with RIB. When routes are aggregated, the originate of the route becomes self. Do not track nexthop self (0.0.0.0) with rib. Ticket: CM-24248 Testing Done: Before fix- tor-11# show ip nht vrf all VRF blue: 0.0.0.0 unresolved Client list: bgp(fd 16) VRF default: VRF green: VRF magenta: 0.0.0.0 unresolved Client list: bgp(fd 16) After fix- tor-11# show ip nht vrf all VRF blue: VRF default: VRF green: VRF magenta: Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-04-03libs: nexthop comparison includes labels if presentMark Stapp
Adjust the nexthop comparison api so that it calls the label- comparison api. Adjust the label-comp api so that "no labels" is "equal". Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-03-29lib, ripd, ripngd: rename remaining delete northbound callbacksRenato Westphal
PR #3622 renamed the "delete" northbound callback to "destroy" in order to make the libfrr headers compatible with C++. This commit renames a few functions that still use "delete" instead of "destroy" in their names. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-03-29Merge remote-tracking branch 'frr/master' into rip-vrfRenato Westphal
Merge commit to solve a bunch of conflicts with other PRs that were merged in the previous weeks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-03-29Merge pull request #4014 from dslicenc/zclient-interface-addRenato Westphal
lib: zclient provide interface info during reg_requests
2019-03-25lib: zclient provide interface info during reg_requestsDon Slice
Problem found in bgpd where it wasn't learning interface address information at startup due to the interface information becoming available before the bgp instance was created. This issue was caused by an earlier change that tried to make the interface information discovery process more efficient but left this hole for bgpd. For now, putting back in the previous method of gathering interface info via the zclient_send_reg_requests call and will revisit a more efficient way to get the info in the future. Ticket: CM-23932 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-03-25lib: Improve debugs in zclient.cDonald Sharp
Fixup a couple of places to improve debugging of what is going on in zclient.c. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-25lib: Fixup missing log entriesDonald Sharp
Add a few missing log entries to the macro to allow us to print out the zapi message type, since they were missing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-25Merge pull request #3772 from pguibert6WIND/vrf_backend_unknownDonald Sharp
Vrf backend unknown
2019-03-22Merge pull request #3776 from opensourcerouting/pbrd-interface-nexthopsDonald Sharp
pbrd: add support for interface nexthops
2019-03-22Merge pull request #3972 from mjstapp/fix_privs_raceDonald Sharp
libs: fix race in privs changes
2019-03-17libs: fix race in privs changesMark Stapp
Use the privs struct mutex more strictly, to ensure that the privs are at the level the caller expects when the apis return. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-03-15Merge pull request #3949 from qlyoung/remove-zlog-newlinesSri Mohana Singamsetty
*: remove trailing newlines from zlog messages
2019-03-15Merge pull request #3902 from opensourcerouting/fix-removal-np-containersDonald Sharp
lib: fix removal of yang non-presence containers
2019-03-14*: remove trailing newlines from zlog messagesQuentin Young
Zlog puts its own newlines on, and doing this makes logs look nasty. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-03-06Merge pull request #3911 from mjstapp/fix_privs_deadlockDavid Lamparter
libs: make privilege elevation thread-safe
2019-03-06Merge pull request #3869 from qlyoung/cocci-fixesDavid Lamparter
Assorted Coccinelle fixes
2019-03-05libs: make privilege escalation thread-safeMark Stapp
Privs escalation is process-wide, and a multi-threaded process can deadlock. This adds a mutex and a counter to the privs object, preventing multiple threads from making the privs escalation system call. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-03-02lib: fix removal of yang non-presence containersRenato Westphal
Non-presence containers don't have "destroy" callbacks. So, once a np-container is deleted, we need to call the "destroy" callbacks of its child nodes instead. This commit doesn't fix any real problem as of now since all np-containers from the FRR YANG modules contain or one more mandatory child nodes, so they can't be deleted (libyang will add missing np-containers when validating data). Nevertheless, upcoming YANG modules should benefit from this change. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-03-02lib: simplify code that calculates configuration diffsRenato Westphal
This is just a small refactoring to reduce code duplication. No behavior changes intended. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-03-01Merge pull request #3877 from qlyoung/remove-strncpyRenato Westphal
Remove strncpy
2019-03-01Merge pull request #3882 from vivek-cumulus/refine_evpn_route_addSri Mohana Singamsetty
Refine install of EVPN-based routes to remove some special handling
2019-03-01Merge pull request #3606 from pguibert6WIND/if_rmap_containerDonald Sharp
lib, rip, ripng, eigrp: rework if_rmap context
2019-02-27*: Explicitly mark nexthop of EVPN-sourced routes as onlinkvivek
In the case of EVPN symmetric routing, the tenant VRF is associated with a VNI that is used for routing and commonly referred to as the L3 VNI or VRF VNI. Corresponding to this VNI is a VLAN and its associated L3 (IP) interface (SVI). Overlay next hops (i.e., next hops for routes in the tenant VRF) are reachable over this interface. Howver, in the model that is supported in the implementation and commonly deployed, there is no explicit Overlay IP address associated with the next hop in the tenant VRF; the underlay IP is used if (since) the forwarding plane requires a next hop IP. Therefore, the next hop has to be explicit flagged as onlink to cause any next hop reachability checks in the forwarding plane to be skipped. https://tools.ietf.org/html/draft-ietf-bess-evpn-prefix-advertisement section 4.4 provides additional description of the above constructs. Use existing mechanism to specify the nexthops as onlink when installing these routes from bgpd to zebra and get rid of a special flag that was introduced for EVPN-sourced routes. Also, use the onlink flag during next hop validation in zebra and eliminate other special checks. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-26lib: strncpy -> strlcpy | memcpyQuentin Young
strncpy is a byte copy function not a string copy function Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: remove casts of XMALLOC / XCALLOCQuentin Young
No cast necessary for void * Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25lib: STAILQ_FOREACH_SAFE never gives a null elemQuentin Young
So don't check it Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: do not check XMALLOC / XCALLOC for null retQuentin Young
They never return NULL Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: use array_size instead of raw divisionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: remove unnecessary semicolon from switchesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: return bool from boolean functionsQuentin Young
Not 1 or 0. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: use proper bool initializers & fix comparisonsQuentin Young
- bools should be initialized with true/false - bools do not need to be compared Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25lib: add compatibility #define for hash_backetQuentin 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-23Merge pull request #3836 from opensourcerouting/debian/master-kill-backportsDonald Sharp
[master] debian packaging