summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-02-04lib: fix route map generic error outputRafael Zalamena
Two fixes here: * Don't attempt to use `vty` pointer in vty; * When `vty` is unavailable output to log; Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-04yang/lib: add filter model to codeRafael Zalamena
This fixes a warning on daemons that use route map about filter yang model not being included in the binary. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-04lib: implement new route map CLIRafael Zalamena
Use the northbound back-end instead of the old route map CLI. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-04lib: implement route map northboundRafael Zalamena
Based on the route map old CLI, implement the route map handling using the exported functions. Use a curry-like programming pattern avoid code repetition when destroying match/set entries. This is needed by other daemons that implement custom route map functions and need to pass to lib their specific destroy functions. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-04lib: export route map structures and functionsRafael Zalamena
These exported items are going to be used by the new northbound CLI. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-04Merge pull request #5653 from ↵Donald Sharp
slankdev/slankdev-bgpd-support-prefix-sid-srv6-l3vpn bgpd: additional Prefix-SID sub-types for supporting SRv6 l3vpn
2020-02-04Merge pull request #5746 from donaldsharp/bgp_saRuss White
Coverioty sa stuff
2020-02-04lib: Test return of fcntl in agentx.cDonald Sharp
The agentx.c code was calling fcntl but not testing return code and handling it, thus making SA unhappy. Fix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-03*: don't null after XFREE; XFREE does this itselfQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-30lib: Adding GR capabilites encode and decode.Santosh P K
For Graceful restart clients have to send GR capabilities library functions are added to encode capabilities and also for zebra to decode client capabilities. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Soman K S <somanks@vmware.com> Signed-off-by: Santosh P K <sapk@vmware.com>
2020-01-28Merge pull request #5210 from bisdhdh/masterRuss White
bgpd:BGP Graceful Restart Per Neighbor(BGPN) Feature.
2020-01-28Merge pull request #4773 from thozza/31-prefix-bcast-addrRuss White
ipv4_broadcast_addr() didn't comply with RFC3021
2020-01-23bgpd: BGP Garaceful Restart debug logs.bisdhdh
Reorganizing bgp gr debug logs and code review comments. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23bgpd: Zebra lib for Graceful Restart.bisdhdh
These changes are for Zebra lib in order to supportGraceful Restart feature. These changes are addedtemporarily, until Zebra Graceful Restart lib Pr is merged. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com> Signed-off-by: Soman K S <somanks@vmware.com>
2020-01-23bgpd: Adding BGP GR Global & Per Neighbour FSM changesbisdhdh
* Added FSM for peer and global configuration for graceful restart * Added debug option BGP_GRACEFUL_RESTART for logs specific to graceful restart processing Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23bgpd: BGP Graceful Restart Per Neighbor(BGPN), DS & header files.bisdhdh
This pr contains all the header files changes for BGP GR per Neighbour(BGPN) feature. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-22lib: add macro to check if value is valid afiQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-20lib: Fix missing __be16 typedef on CentOS6Martin Winter
Need to include linux/types.h on older Linux Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-01-18Merge pull request #5707 from donaldsharp/nexthop_encodingDonatas Abraitis
Nexthop encoding
2020-01-18lib: Fix nexthop encodingDonald Sharp
Commit 68a02e06e5f103048d947262c08c569056f74d1c broke nexthop encoding for nexthop tracking. This code combined the different types of nexthop encoding being done in the zapi protocol. What was missed that resolved nexthops of type NEXTHOP_TYPE_IPV4|6 have an ifindex value that was not being reported. This commit ensures that we always send this data( even if it is 0). The following test commit will ensure that this stays working as is expected by an upper level protocol. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-17build: fix auto git ID lengthDavid Lamparter
This script was written back when `git describe` would abbreviate to 7-char commit IDs; they're longer now and we're grabbing the tail end... Signed-off-by: David Lamparter <equinox@diac24.net>
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-15bgpd: prefix-sid srv6 l3vpn service tlvHiroki Shirokura
bgpd already supports BGP Prefix-SID path attribute and there are some sub-types of Prefix-SID path attribute. This commits makes bgpd to support additional sub-types. sub-Type-4 and sub-Type-5 for construct the VPNv4 SRv6 backend with vpnv4-unicast address family. This path attributes is already supported by Ciscos IOS-XR and NX-OS. Prefix-SID sub-Type-4 and sub-Type-5 is defined on following IETF-drafts. Supports(A-part-of): - https://tools.ietf.org/html/draft-dawra-idr-srv6-vpn-04 - https://tools.ietf.org/html/draft-dawra-idr-srv6-vpn-05 Signed-off-by: Hiroki Shirokura <slank.dev@gmail.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>