summaryrefslogtreecommitdiff
path: root/pbrd/pbr_zebra.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-09-17 15:32:01 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2020-09-22 15:40:32 -0400
commitf08966a58dbc80cb53506436694996bb3f4e2f9a (patch)
treea365300ec0f0243f06481a99b32d16cebb1eb5a8 /pbrd/pbr_zebra.c
parente2dcd0c2c5fe2a45a9bcd34a9cdce8a9059e0ec7 (diff)
pbrd: add return val for pbr_send_pbr_map()
Add a return val so caller can know if something was actually sent to zebra here. Some things need to be cleanued up by the caller if we arent getting a callback from zapi. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'pbrd/pbr_zebra.c')
-rw-r--r--pbrd/pbr_zebra.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 269bd6da8d..077cb9a691 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -549,8 +549,8 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
stream_put(s, ifp->name, INTERFACE_NAMSIZ);
}
-void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
- struct pbr_map_interface *pmi, bool install, bool changed)
+int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
+ struct pbr_map_interface *pmi, bool install, bool changed)
{
struct pbr_map *pbrm = pbrms->parent;
struct stream *s;
@@ -569,10 +569,10 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
* to delete just return.
*/
if (install && is_installed && !changed)
- return;
+ return 1;
if (!install && !is_installed)
- return;
+ return 1;
s = zclient->obuf;
stream_reset(s);
@@ -595,4 +595,6 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
stream_putw_at(s, 0, stream_get_endp(s));
zclient_send_message(zclient);
+
+ return 0;
}