diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2020-03-26 17:33:53 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2020-11-23 18:16:35 +0100 |
commit | fef2ed139d140f551cdfcbb21c5a023dea2e02cb (patch) | |
tree | ec4a61a4744d0cc2924bb964f4b77017cf865c0f /nhrpd/nhrpd.h | |
parent | Merge pull request #7569 from patrasar/pim_coverity_fix (diff) | |
download | frr-fef2ed139d140f551cdfcbb21c5a023dea2e02cb.tar.xz frr-fef2ed139d140f551cdfcbb21c5a023dea2e02cb.zip |
nhrpd: cache config may disappear if iface not present at startup
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>
Diffstat (limited to 'nhrpd/nhrpd.h')
-rw-r--r-- | nhrpd/nhrpd.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h index cbee5951f..80a365a3c 100644 --- a/nhrpd/nhrpd.h +++ b/nhrpd/nhrpd.h @@ -197,6 +197,13 @@ enum nhrp_cache_type { extern const char *const nhrp_cache_type_str[]; extern unsigned long nhrp_cache_counts[NHRP_CACHE_NUM_TYPES]; +struct nhrp_cache_config { + struct interface *ifp; + union sockunion remote_addr; + enum nhrp_cache_type type; + union sockunion nbma; +}; + struct nhrp_cache { struct interface *ifp; union sockunion remote_addr; @@ -280,6 +287,7 @@ struct nhrp_interface { uint32_t grekey; struct hash *peer_hash; + struct hash *cache_config_hash; struct hash *cache_hash; struct notifier_list notifier_list; @@ -358,10 +366,16 @@ void nhrp_shortcut_foreach(afi_t afi, void nhrp_shortcut_purge(struct nhrp_shortcut *s, int force); void nhrp_shortcut_prefix_change(const struct prefix *p, int deleted); +void nhrp_cache_config_free(struct nhrp_cache_config *c); +struct nhrp_cache_config *nhrp_cache_config_get(struct interface *ifp, + union sockunion *remote_addr, + int create); struct nhrp_cache *nhrp_cache_get(struct interface *ifp, union sockunion *remote_addr, int create); void nhrp_cache_foreach(struct interface *ifp, void (*cb)(struct nhrp_cache *, void *), void *ctx); +void nhrp_cache_config_foreach(struct interface *ifp, + void (*cb)(struct nhrp_cache_config *, void *), void *ctx); void nhrp_cache_set_used(struct nhrp_cache *, int); int nhrp_cache_update_binding(struct nhrp_cache *, enum nhrp_cache_type type, int holding_time, struct nhrp_peer *p, |