summaryrefslogtreecommitdiffstats
path: root/sharpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-07 00:21:50 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-11-15 20:50:17 +0100
commit8a3f8f2e4ae1e8aaa3666fd8d38780e753bc09e7 (patch)
tree6d39449fbe173f576de0c4309dc284d837a6edb1 /sharpd
parentsharpd: Add buffering support (diff)
downloadfrr-8a3f8f2e4ae1e8aaa3666fd8d38780e753bc09e7.tar.xz
frr-8a3f8f2e4ae1e8aaa3666fd8d38780e753bc09e7.zip
bgpd, lib, sharpd: Add enum for zclient_send_message return
Add a `enum zclient_send_status` for appropriate handling of return codes from zclient_send_message. Touch all the places where we handle this. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'sharpd')
-rw-r--r--sharpd/sharp_zebra.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 2ef9af897..e88904097 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -289,7 +289,8 @@ static bool route_add(const struct prefix *p, vrf_id_t vrf_id, uint8_t instance,
api.backup_nexthop_num = i;
}
- if (zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api) == 1)
+ if (zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api)
+ == ZCLIENT_SEND_BUFFERED)
return true;
else
return false;
@@ -312,7 +313,8 @@ static bool route_delete(struct prefix *p, vrf_id_t vrf_id, uint8_t instance)
api.instance = instance;
memcpy(&api.prefix, p, sizeof(*p));
- if (zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api) == 1)
+ if (zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api)
+ == ZCLIENT_SEND_BUFFERED)
return true;
else
return false;
@@ -356,8 +358,6 @@ static void sharp_install_routes_restart(struct prefix *p, uint32_t count,
return;
}
}
-
- return;
}
void sharp_install_routes_helper(struct prefix *p, vrf_id_t vrf_id,
@@ -409,8 +409,6 @@ static void sharp_remove_routes_restart(struct prefix *p, uint32_t count,
return;
}
}
-
- return;
}
void sharp_remove_routes_helper(struct prefix *p, vrf_id_t vrf_id,
@@ -454,12 +452,10 @@ static void sharp_zclient_buffer_ready(void)
wb.instance, wb.nhgid, wb.nhg,
wb.backup_nhg, wb.routes);
return;
- break;
case SHARP_DELETE_ROUTES_RESTART:
sharp_remove_routes_restart(&wb.p, wb.count, wb.vrf_id,
wb.instance, wb.routes);
return;
- break;
}
}