summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-05-25 10:47:40 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-05-30 08:03:13 -0400
commit1e88567226fada65009c3cac635e5e280121eecc (patch)
tree23dc9fd7010e3b4ad1c29d538ca90c365b8da5b4 /zebra/zebra_rib.c
parent215181cbf144f86ee87965174029e76f88aec42b (diff)
zebra: Add a result from dataplane request
Add a bit of code to allow return of data plane request messages. Add the ability to pass the result back to callers of kernel_route_rib. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 4a4b0c7810..879e7e8317 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1123,8 +1123,17 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
* the kernel.
*/
hook_call(rib_update, rn, "installing in kernel");
- kernel_route_rib(rn, p, src_p, old, re);
- zvrf->installs++;
+ switch (kernel_route_rib(rn, p, src_p, old, re)) {
+ case DP_REQUEST_QUEUED:
+ zlog_err("No current known DataPlane interfaces can return this, please fix");
+ break;
+ case DP_REQUEST_FAILURE:
+ zlog_err("No current known Rib Install Failure cases, please fix");
+ break;
+ case DP_REQUEST_SUCCESS:
+ zvrf->installs++;
+ break;
+ }
return;
}
@@ -1150,9 +1159,18 @@ void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re)
* the kernel.
*/
hook_call(rib_update, rn, "uninstalling from kernel");
- kernel_route_rib(rn, p, src_p, re, NULL);
- if (zvrf)
- zvrf->removals++;
+ switch (kernel_route_rib(rn, p, src_p, re, NULL)) {
+ case DP_REQUEST_QUEUED:
+ zlog_err("No current known DataPlane interfaces can return this, please fix");
+ break;
+ case DP_REQUEST_FAILURE:
+ zlog_err("No current known RIB Install Failure cases, please fix");
+ break;
+ case DP_REQUEST_SUCCESS:
+ if (zvrf)
+ zvrf->removals++;
+ break;
+ }
return;
}