summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-01-25 09:00:19 +0100
committerGitHub <noreply@github.com>2024-01-25 09:00:19 +0100
commit14c7797b725bd263fb662c9b712fbe041e1bc118 (patch)
tree57b9d1f663b5a188ae4c932fd9d75e79d19062f4
parentMerge pull request #15215 from donaldsharp/pceplib_fixup (diff)
parentpbrd: Fix PBR handling for last rule deletion (diff)
downloadfrr-14c7797b725bd263fb662c9b712fbe041e1bc118.tar.xz
frr-14c7797b725bd263fb662c9b712fbe041e1bc118.zip
Merge pull request #15206 from routingrocks/rajesh/pbr_map
pbrd: Fix PBR handling for last rule deletion
-rw-r--r--pbrd/pbr_nht.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index b9d1ca9bb..ff252f850 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -650,7 +650,15 @@ static void pbr_nht_release_individual_nexthop(struct pbr_map_sequence *pbrms)
void pbr_nht_delete_individual_nexthop(struct pbr_map_sequence *pbrms)
{
- pbr_map_delete_nexthops(pbrms);
+ struct pbr_map *pbrm = pbrms->parent;
+
+ /* The idea here is to send a delete command to zebra only once,
+ * and set 'valid' and 'installed' to false only when the last
+ * rule is being deleted. In other words, the pbr common should be
+ * updated only when the last rule is being updated or deleted.
+ */
+ if (pbrm->seqnumbers->count == 1)
+ pbr_map_delete_nexthops(pbrms);
pbr_nht_release_individual_nexthop(pbrms);
}