summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-09-17 21:34:36 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2020-09-22 21:40:51 +0200
commitfe870621b577e3a486604b95cedd4fde86d36ccd (patch)
tree21ea3290928222df48ebccceddbddc121f2f4194 /pbrd
parentpbrd: add return val for pbr_send_pbr_map() (diff)
downloadfrr-fe870621b577e3a486604b95cedd4fde86d36ccd.tar.xz
frr-fe870621b577e3a486604b95cedd4fde86d36ccd.zip
pbrd: cleanup pbr ifp info if not sent to zebra
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>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_map.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index fe2778c87..b282db999 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -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);
}
/*