summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrp_cache.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* nhrpd: Use our built-in printf functionalityDonald Sharp2021-03-101-24/+11
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* libs,nhrpd: remove exec permMark Stapp2021-01-121-0/+0
| | | | | | | Some source files got the exec bit set in a recent commit - undo that. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* nhrpd: Cleanup resources when interface is deletedReuben Dowle2020-12-161-2/+40
| | | | | | | | | | | | Currently when an interface is deleted from configuration, associated resources are not freed. This causes memory leaks and crashes. To reproduce this issue: * Connect to a DMVPN hub * Outside of frr, delete the underlying GRE interface * Use 'no interface xxx' to delete the interface containing nhrp configurations Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
* nhrpd: cache config may disappear if iface not present at startupPhilippe Guibert2020-11-231-0/+86
| | | | | | | | When interface not present at config time, store separately the list of config parameters. Then, when interface is ready and an address has been configured, the nbma setting is done. Reversely, when interface disappears, there is no need to keep the maps present, then keep only the configuration. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd, lib, nhrpd, zebra: verify return of sockunion2hostprefixDonald Sharp2020-11-181-2/+3
| | | | | | | | | | | | | | The return from sockunion2hostprefix tells us if the conversion succeeded or not. There are places in the code where we always assume that it just `works`, since it can fail notice and try to do the right thing. Please note that failure of this function for most cases of sockunion2hostprefix is highly highly unlikely as that the sockunion was already created and tested elsewhere it's just that this function can fail. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* nhrpd: resolve formatting warningsGhasem Naddaf2020-03-111-22/+18
| | | | Signed-off-by: Ghasem Naddaf <gshirazi@infoblox.com>
* Merge branch 'master' into nhrp_bugfixGhasem Naddaf2020-03-111-2/+2
|\
| * *: Replace `sizeof something` to sizeof(something)Donatas Abraitis2020-03-081-2/+2
| | | | | | | | | | | | Satisfy checkpatch.pl requirements (check for sizeof without parenthesis) Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | nhrpd: route update support for natoa nbmaGhasem Naddaf2020-02-271-4/+86
|/ | | | | | | | | | nhrp_cache_update_route, nhrp_cache_authorize_binding: Fix route update for NAT scenario. When remote_nbma_natoa is already set in the cache entry, binding should be updated to this value and not vc remote nbma, which would be different from the NATted address. nhrp_shortcut_recv_resolution_rep: Simplify the logic for finding the natoa nbma. Also, install shortcut entries as DYNAMIC type, as suggested in Section 6.2.2 of RFC2332. nhrp_shortcut_cache_notify: announce the installed route with the correct interface from cache. Signed-off-by: Ghasem Naddaf <gshirazi@infoblox.com>
* lib: hashing functions should take const argumentsQuentin Young2019-05-141-2/+2
| | | | | | | | | | It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: Rename backet to bucketTim Bray2019-02-251-1/+1
| | | | | | Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
* *: Replace hash_cmp function return value to a boolDonald Sharp2018-10-191-1/+3
| | | | | | | | | The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: ALLOC calls cannot failDonald Sharp2018-08-111-11/+10
| | | | | | | | There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-52/+76
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* nhrpd: Add hash table namesDonald Sharp2017-09-051-1/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* nhrp: fix assertion with negative holding timesJorge Boncompte2017-08-041-1/+1
| | | | | | Correctly reset status or we later assert at nhrp_cache_free(). Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* *: update hash_create(), hash_create_size()Quentin Young2017-07-021-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* nhrpd: adapt to API changesDavid Lamparter2017-03-071-3/+5
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* nhrpd: implement next hop resolution protocolTimo Teräs2017-03-071-0/+341
This provides DMVPN support and integrates to strongSwan. Please read README.nhrpd and README.kernel for more details. [DL: cherry-picked from dafa05e65fe4b3b3ed5525443f554215ba14f42c] [DL: merge partially resolved, this commit will not build.] Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>