Skip to content

Commit

Permalink
Merge pull request #15229 from FRRouting/mergify/bp/stable/9.0/pr-15206
Browse files Browse the repository at this point in the history
pbrd: Fix PBR handling for last rule deletion (backport #15206)
  • Loading branch information
donaldsharp authored Jan 25, 2024
2 parents 6c77f04 + a8a80cc commit 66a1a1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pbrd/pbr_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,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);
}
Expand Down

0 comments on commit 66a1a1c

Please sign in to comment.