summaryrefslogtreecommitdiff
path: root/zebra/zebra_nhg.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_nhg.c')
-rw-r--r--zebra/zebra_nhg.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index ac8f4745d6..1ed7ff00e5 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -2853,7 +2853,7 @@ struct nhg_hash_entry *zebra_nhg_proto_add(uint32_t id, int type,
}
/* Delete NHE from upper level proto, caller must decrement ref */
-struct nhg_hash_entry *zebra_nhg_proto_del(uint32_t id)
+struct nhg_hash_entry *zebra_nhg_proto_del(uint32_t id, int type)
{
struct nhg_hash_entry *nhe;
@@ -2866,6 +2866,15 @@ struct nhg_hash_entry *zebra_nhg_proto_del(uint32_t id)
return NULL;
}
+ if (type != nhe->type) {
+ if (IS_ZEBRA_DEBUG_NHG)
+ zlog_debug(
+ "%s: id %u, type %s mismatch, sent by %s, ignoring",
+ __func__, id, zebra_route_string(nhe->type),
+ zebra_route_string(type));
+ return NULL;
+ }
+
if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_PROTO_RELEASED)) {
if (IS_ZEBRA_DEBUG_NHG)
zlog_debug("%s: id %u, already released", __func__, id);