summaryrefslogtreecommitdiffstats
path: root/sharpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-11 20:14:37 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-11-15 21:04:52 +0100
commit7cfdb48554329b1fb7d0469d0ebf2bfa816c5eea (patch)
tree50d3a706d34cd135865356c0d95f04511497510b /sharpd
parentbgpd, lib, sharpd: Add enum for zclient_send_message return (diff)
downloadfrr-7cfdb48554329b1fb7d0469d0ebf2bfa816c5eea.tar.xz
frr-7cfdb48554329b1fb7d0469d0ebf2bfa816c5eea.zip
*: Convert all usage of zclient_send_message to new enum
The `enum zclient_send_status` enum needs to be extended throughout the code base to use the new states and to fix up places where we tested against the return value being non zero. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'sharpd')
-rw-r--r--sharpd/sharp_zebra.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index e88904097..627caea37 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -211,9 +211,10 @@ int sharp_install_lsps_helper(bool install_p, bool update_p,
cmd = ZEBRA_MPLS_LABELS_DELETE;
}
- ret = zebra_send_mpls_labels(zclient, cmd, &zl);
+ if (zebra_send_mpls_labels(zclient, cmd, &zl) == ZCLIENT_SEND_FAILURE)
+ return -1;
- return ret;
+ return 0;
}
enum where_to_restart {
@@ -590,7 +591,8 @@ void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import,
command = ZEBRA_IMPORT_ROUTE_UNREGISTER;
}
- if (zclient_send_rnh(zclient, command, p, connected, vrf_id) < 0)
+ if (zclient_send_rnh(zclient, command, p, connected, vrf_id)
+ == ZCLIENT_SEND_FAILURE)
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
}
@@ -776,7 +778,7 @@ void sharp_opaque_send(uint32_t type, uint32_t proto, uint32_t instance,
ret = zclient_send_opaque_unicast(zclient, type, proto,
instance, session_id,
buf, sizeof(buf));
- if (ret < 0) {
+ if (ret == ZCLIENT_SEND_FAILURE) {
zlog_debug("%s: send_opaque() failed => %d",
__func__, ret);
break;