mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 20:34:33 +00:00
lib: Add a warning for when we are not operating correctly
There exists a possibilty that route map dependencies have gotten wrong. Prevent the crash and warn the user that we may be in trouble. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
02e7a369b8
commit
9149c63517
@ -2767,11 +2767,18 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
|
|||||||
memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
|
memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
|
||||||
tmp_dep_data.rname = rname;
|
tmp_dep_data.rname = rname;
|
||||||
dep_data = hash_lookup(dep->dep_rmap_hash, &tmp_dep_data);
|
dep_data = hash_lookup(dep->dep_rmap_hash, &tmp_dep_data);
|
||||||
|
/*
|
||||||
if (!dep_data)
|
* If dep_data is NULL then something has gone seriously
|
||||||
|
* wrong in route-map handling. Note it and prevent
|
||||||
|
* the crash.
|
||||||
|
*/
|
||||||
|
if (!dep_data) {
|
||||||
|
zlog_warn(
|
||||||
|
"route-map dependency for route-map %s: %s is not correct",
|
||||||
|
rmap_name, dep_name);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (dep_data->refcnt)
|
|
||||||
dep_data->refcnt--;
|
dep_data->refcnt--;
|
||||||
|
|
||||||
if (!dep_data->refcnt) {
|
if (!dep_data->refcnt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user