Merge pull request #15228 from FRRouting/mergify/bp/stable/9.1/pr-15206

pbrd: Fix PBR handling for last rule deletion (backport #15206)
This commit is contained in:
Donald Sharp 2024-01-25 09:35:59 -05:00 committed by GitHub
commit da022905ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) 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); pbr_nht_release_individual_nexthop(pbrms);
} }