Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pbrd: Fix PBR handling for last rule deletion (backport #15206) #15228

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pbrd/pbr_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,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
Loading