summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-04-24Merge pull request #8495 from opensourcerouting/ospfv3-bfd-reworkIgor Ryzhov
ospf6d: rework BFD integration and add BFD profiles support
2021-04-22lib: BFD session handling improvementRafael Zalamena
Don't uninstall sessions if the address, interface, VRF or TTL didn't change. Update the library documentation to make it clear to other developers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22lib: fix possible crash on BFD notificationRafael Zalamena
Allow sessions to remove themselves from the notifications without risking crashes. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22Merge pull request #8536 from idryzhov/bfd-enabledRafael Zalamena
lib: remove enabled flag for bfd sessions
2021-04-22lib: remove enabled flag for bfd sessionsIgor Ryzhov
Currently this flag is only helpful in an extremely rare situation when the BFD session registration was unsuccessful and after that zebra is restarted. Let's remove this flag to simplify the API. If we ever want to solve the problem of unsuccessful registration/deregistration, this can be done using internal flags, without API modification. Also add the error log to help user understand why the BFD session is not working. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-21build: run autoupdateDavid Lamparter
AC_TRY_COMPILE is deprecated too. Also configure.ac isn't executable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21build: remove deprecated AC_WORDS_BIGENDIANDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21build: properly split CFLAGS from AC_CFLAGSDavid Lamparter
`CFLAGS` is a "user variable", not intended to be controlled by configure itself. Let's put all the "important" stuff in AC_CFLAGS and only leave debug/optimization controls in CFLAGS. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21build: make builddir include path consistentDavid Lamparter
... by referencing all autogenerated headers relative to the root directory. (90% of the changes here is `version.h`.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-19lib: fix bogus unlinkat() warning in zlog TLS exitDavid Lamparter
Only try to unlink the buffer if we actually set it up beforehand... Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-19lib: don't print 2 backtraces for crashesDavid Lamparter
abort() raises SIGABRT, which would confusingly cause a 2nd backtrace to be printed after the first one... Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-16Merge pull request #8465 from opensourcerouting/vtysh-scan-snafuMark Stapp
fix vtysh_scan SNAFUs
2021-04-15vtysh: add lib/thread.c to vtysh_scanDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15vtysh: add lib/resolver.c to vtysh_scanDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15vtysh: add lib/spf_backoff.c to vtysh_scanDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15vtysh: add lib/log_vty.c to vtysh_scanDavid Lamparter
Rather than copying everything over, include the file in vtysh_scan for automatic pickup. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15Merge pull request #8483 from opensourcerouting/asan-fixQuentin Young
lib: disable ASAN redzone around xref_p/xref_array
2021-04-15Merge pull request #8477 from opensourcerouting/lib-bfd-fixIgor Ryzhov
2021-04-15lib: disable ASAN redzone around xref_p/xref_arrayDavid Lamparter
The "xref_p" variables are placed in the "xref_array" section specifically so they're next to each other and we get an array at the end. The ASAN redzone that is inserted around global variables is breaks that since it'd be inserted before and after each of the array items. So disable the ASAN redzone for these variables (and only these variables, nothing else should be affected.) Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-14Merge pull request #8467 from idryzhov/fix-acl-deleteRenato Westphal
lib: fix access-list deletion
2021-04-14lib: fix BFD crash on interface removalRafael Zalamena
- Handle badly formatted messages (don't set `ifp` in that case) - Handle unread messages (e.g. when family is not don't trigger `assert`) Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-14Merge pull request #8003 from donaldsharp/timingsPatrick Ruddy
lib: Differentiate between real and cpu bound processes
2021-04-14Merge pull request #8320 from idryzhov/prefix-list-seqnumDonald Sharp
lib: remove "ip prefix-list sequence-number" command
2021-04-14lib: fix access-list deletionIgor Ryzhov
Problems with the current implementation: * Delete hook is called before the deletion of the access-list from the master list, which means that daemons processing this hook successfully find this access-list, store a pointer to it in their structures, and right after that the access-list is freed. Daemons end up having stale pointer to the freed structure. * Route-maps are not notified of the deletion. This commit fixes both issues. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-13Merge pull request #8414 from idryzhov/fix-filter-cliRuss White
various acl/plist cli fixes
2021-04-13Merge pull request #8426 from idryzhov/fix-interface-nb-stale-pointersQuentin Young
lib: fix interface nb stale pointers
2021-04-13Merge pull request #8145 from pguibert6WIND/nhrp_use_zebraMark Stapp
nhrp: use zebra
2021-04-13zebra, lib: replace ZEBRA_ROUTE_NEIGH with simplified versionPhilippe Guibert
do not add a new route type, and consider 0 as a value meaning that zebra should be the owner. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13nhrp, zebra, lib: enforce usage of zapi_neigh_ip structurePhilippe Guibert
zapi_nbr structure is renamed to zapi_neigh_ip. Initially used to set a neighbor ip entry for gre interfaces, this structure is used to get events from the zebra layer to nhrp layer. The ndm state has been added, as it is needed on both sides. The zebra dplane layer is slightly modified. Also, to clarify what ZEBRA_NEIGH_ADD/DEL means, a rename is done: it is called now ZEBRA_NEIGH_IP_ADD/DEL, and it signified that this zapi interface permits to set link operations by associating ip addresses to link addresses. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13Merge pull request #8389 from idryzhov/route-map-optimization-nbRenato Westphal
lib: convert route-map optimization to NB
2021-04-13Merge pull request #8288 from qlyoung/readd-space-support-to-find-commandDavid Lamparter
2021-04-12Merge pull request #8421 from opensourcerouting/xrelfo-armMark Stapp
fix xrelfo on ARM(32) & cross-compile
2021-04-12lib: fix interface nb stale pointersIgor Ryzhov
The first change in this commit is the processing of the VRF termination. When we terminate the VRF, we should not delete the underlying interfaces, because there may be pointers to them in the northbound configuration. We should move them to the default VRF instead. Because of the first change, the VRF interface itself is also not deleted when deleting the VRF. It should be handled in netlink_link_change. This is done by the second change. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-09lib, doc: add "route-map NAME optimization" commandIgor Ryzhov
Currently we have a "route-map optimization" command which is entered from inside the route-map entry but actually applies to the whole route-map. In addition, this command is not shown in the running-config and not stored to the startup-config during "write". Let's add a new command on the config node level to control this setting and show it in the running-config to make possible to save it during "write". The old command is saved for the backward compatibility but hidden and marked as deprecated. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-09zebra, lib: handle NEIGH_ADD/DELETE to zebra dataplane frameworkPhilippe Guibert
EVPN neighbor operations were already done in the zebra dataplane framework. Now that NHRP is able to use zebra to perform neighbor IP operations (by programming link IP operations), handle this operation under dataplane framework: - assign two new operations NEIGH_IP_INSTALL and NEIGH_IP_DELETE; this is reserved for GRE like interfaces: example: ip neigh add A.B.C.D lladdr E.F.G.H - use 'struct ipaddr' to store and encode the link ip address - reuse dplane_neigh_info, and create an union with mac address - reuse the protocol type and use it for neighbor operations; this permits to store the daemon originating this neighbor operation. a new route type is created: ZEBRA_ROUTE_NEIGH. - the netlink level functions will handle a pointer, and a type; the type indicates the family of the pointer: AF_INET or AF_INET6 if the link type is an ip address, mac address otherwise. - to keep backward compatibility with old queries, as no extension was done, an option NEIGH_NO_EXTENSION has been put in place - also, 2 new state flags are used: NUD_PERMANENT and NUD_FAILED. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09lib: add api to configure neighbor table per interfacePhilippe Guibert
this api is needed for nhrp. the goal is to implement it in zebra, while other daemon will used it. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09nhrp, lib, zebra: add/del neighbor entry possible from nhrpPhilippe Guibert
a zebra api is extended to offer ability to add or remove neighbor entry from daemon. Also this extension makes possible to add neigh entry, not only between IPs and macs, but also between IPs and NBMA IPs. This API supports configuring ipv6/ipv4 entries with ipv4/ipv6 lladdr. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09zebra: link layer config and notification, implementation in zebraPhilippe Guibert
zebra implements zebra api for configuring link layer information. that can be an arp entry (for ipv4) or ipv6 neighbor discovery entry. This can also be an ipv4/ipv6 entry associated to an underlay ipv4 address, as it is used in gre point to multipoint interfaces. this api will also be used as monitoring. an hash list is instantiated into zebra (this is the vrf bitmap). each client interested in those entries in a specific vrf, will listen for following messages: entries added, removed, or who-has messages. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09lib: link layer neighbor registration and notification, define API msgsPhilippe Guibert
This patch implements new zapi api to get neighbor information that zebra knows and that other daemons may need to know. Actually, nhrp daemons is interested in getting the neighbor information on gre interfaces, and the API will be used for that. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09ospfd: fix crash on "show ip ospf neighbor detail"Igor Ryzhov
Fixes #8419. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-08lib: add DT_REL to elf_py/clippy ELF codeDavid Lamparter
ARM (32-bit) needs DT_REL... and here I was hoping I could avoid the trouble. Fixes: #8355 Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-07lib, vtysh: re-add support for spaces in 'find'Quentin Young
Lost ability to handle them in the regex patch Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-06lib: delete empty access-listsIgor Ryzhov
We should delete the access-list when the last entry and remark is deleted. This is already done for prefix-lists. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06lib: fix deletion of empty prefix-listsIgor Ryzhov
We delete the prefix-list when its last entry is deleted, but the check is missed when we delete the description. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06lib: fix usage of operational data in CLIIgor Ryzhov
CLI must never use operational data, because this won't work in transactional mode. Rework search for prefix-list/access-list entries using only candidate config. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06lib: fix check for duplicated access-list entriesIgor Ryzhov
The correct string representation for "empty" type is an empty string. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06lib: convert route-map optimization to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-02Merge pull request #8376 from mjstapp/fix_remove_inet6_ntoaDonald Sharp
lib, ripngd: Remove inet6_ntoa
2021-04-01Merge pull request #8358 from idryzhov/fix-nb-vrf-crashMark Stapp
*: modify VRF_CONFIGURED flag only in VRF NB layer
2021-03-31Merge pull request #8350 from opensourcerouting/printfrr-revampMark Stapp
lib: `printfrr()` care package