Skip to content

Commit

Permalink
pbrd: cleanup pbr ifp info if not sent to zebra
Browse files Browse the repository at this point in the history
Properly cleanup the pbr interface data if nothing actually
gets sent to zebra, since we will never get the callback
notification from zapi to issue final deletion.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
  • Loading branch information
sworleys committed Sep 22, 2020
1 parent f08966a commit fe87062
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pbrd/pbr_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,23 @@ void pbr_map_policy_delete(struct pbr_map *pbrm, struct pbr_map_interface *pmi)
{
struct listnode *node;
struct pbr_map_sequence *pbrms;
bool sent = false;


for (ALL_LIST_ELEMENTS_RO(pbrm->seqnumbers, node, pbrms))
pbr_send_pbr_map(pbrms, pmi, false, false);
if (!pbr_send_pbr_map(pbrms, pmi, false, true))
sent = true; /* rule removal sent to zebra */

pmi->delete = true;

/*
* If we actually sent something for deletion, wait on zapi callback
* before clearing data.
*/
if (sent)
return;

pbr_map_final_interface_deletion(pbrm, pmi);
}

/*
Expand Down

0 comments on commit fe87062

Please sign in to comment.