summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2024-07-30 11:16:32 -0400
committerGitHub <noreply@github.com>2024-07-30 11:16:32 -0400
commit43b9faf8f2e9b618f2bcd08c6e5195edf45d251f (patch)
tree95281002cbb80917131898838c8e4f7ff3c037a5
parentb8747d81a55e1ec1a4084649273cfb5921eb2739 (diff)
parente53fa582bcfe1ab7e26e43f4972b68222f4d1f9c (diff)
Merge pull request #16494 from donaldsharp/gr_meta_q
zebra: Fix removal of routes on MetaQ when client goes down
-rw-r--r--zebra/zebra_rib.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 142f83fb36..0f02b0a2ec 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3837,7 +3837,8 @@ static void rib_meta_queue_free(struct meta_queue *mq, struct list *l,
}
static void early_route_meta_queue_free(struct meta_queue *mq, struct list *l,
- struct zebra_vrf *zvrf)
+ const struct zebra_vrf *zvrf,
+ uint8_t proto, uint8_t instance)
{
struct zebra_early_route *ere;
struct listnode *node, *nnode;
@@ -3846,6 +3847,10 @@ static void early_route_meta_queue_free(struct meta_queue *mq, struct list *l,
if (zvrf && ere->re->vrf_id != zvrf->vrf->vrf_id)
continue;
+ if (proto != ZEBRA_ROUTE_ALL &&
+ (proto != ere->re->type && instance != ere->re->instance))
+ continue;
+
early_route_memory_free(ere);
node->data = NULL;
list_delete_node(l, node);
@@ -3884,7 +3889,8 @@ void meta_queue_free(struct meta_queue *mq, struct zebra_vrf *zvrf)
evpn_meta_queue_free(mq, mq->subq[i], zvrf);
break;
case META_QUEUE_EARLY_ROUTE:
- early_route_meta_queue_free(mq, mq->subq[i], zvrf);
+ early_route_meta_queue_free(mq, mq->subq[i], zvrf,
+ ZEBRA_ROUTE_ALL, 0);
break;
case META_QUEUE_EARLY_LABEL:
early_label_meta_queue_free(mq, mq->subq[i], zvrf);
@@ -4752,6 +4758,10 @@ unsigned long rib_score_proto(uint8_t proto, unsigned short instance)
if (!zvrf)
continue;
+ early_route_meta_queue_free(zrouter.mq,
+ zrouter.mq->subq[META_QUEUE_EARLY_ROUTE],
+ zvrf, proto, instance);
+
cnt += rib_score_proto_table(proto, instance,
zvrf->table[AFI_IP][SAFI_UNICAST])
+ rib_score_proto_table(