diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-05-25 17:07:34 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-05-30 14:05:29 +0200 |
commit | 7c5d0e1853597d398dda77494217f58a425e57df (patch) | |
tree | 8b1c971d20b359cfc5a5f5c7793217bfe2551b4d /zebra/zebra_mpls_netlink.c | |
parent | zebra: Add knowledge of request success/failure for pbr rules (diff) | |
download | frr-7c5d0e1853597d398dda77494217f58a425e57df.tar.xz frr-7c5d0e1853597d398dda77494217f58a425e57df.zip |
zebra: Add `enum dp_req_result` to lsp install/deletes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mpls_netlink.c')
-rw-r--r-- | zebra/zebra_mpls_netlink.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/zebra/zebra_mpls_netlink.c b/zebra/zebra_mpls_netlink.c index 15aba89a2..245a77178 100644 --- a/zebra/zebra_mpls_netlink.c +++ b/zebra/zebra_mpls_netlink.c @@ -29,13 +29,13 @@ /* * Install Label Forwarding entry into the kernel. */ -void kernel_add_lsp(zebra_lsp_t *lsp) +enum dp_req_result kernel_add_lsp(zebra_lsp_t *lsp) { int ret; if (!lsp || !lsp->best_nhlfe) { // unexpected kernel_lsp_pass_fail(lsp, DP_INSTALL_FAILURE); - return; + return DP_REQUEST_FAILURE; } ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp); @@ -43,6 +43,8 @@ void kernel_add_lsp(zebra_lsp_t *lsp) kernel_lsp_pass_fail(lsp, (!ret) ? DP_INSTALL_SUCCESS : DP_INSTALL_FAILURE); + + return DP_REQUEST_SUCCESS; } /* @@ -56,13 +58,13 @@ void kernel_add_lsp(zebra_lsp_t *lsp) * through the metric field (before kernel-MPLS). This shouldn't be an issue * any longer, so REPLACE can be reintroduced. */ -void kernel_upd_lsp(zebra_lsp_t *lsp) +enum dp_req_result kernel_upd_lsp(zebra_lsp_t *lsp) { int ret; if (!lsp || !lsp->best_nhlfe) { // unexpected kernel_lsp_pass_fail(lsp, DP_INSTALL_FAILURE); - return; + return DP_REQUEST_FAILURE; } ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp); @@ -70,23 +72,25 @@ void kernel_upd_lsp(zebra_lsp_t *lsp) kernel_lsp_pass_fail(lsp, (!ret) ? DP_INSTALL_SUCCESS : DP_INSTALL_FAILURE); + + return DP_REQUEST_SUCCESS; } /* * Delete Label Forwarding entry from the kernel. */ -void kernel_del_lsp(zebra_lsp_t *lsp) +enum dp_req_result kernel_del_lsp(zebra_lsp_t *lsp) { int ret; if (!lsp) { // unexpected kernel_lsp_pass_fail(lsp, DP_DELETE_FAILURE); - return; + return DP_REQUEST_FAILURE; } if (!CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) { kernel_lsp_pass_fail(lsp, DP_DELETE_FAILURE); - return; + return DP_REQUEST_FAILURE; } ret = netlink_mpls_multipath(RTM_DELROUTE, lsp); @@ -94,6 +98,8 @@ void kernel_del_lsp(zebra_lsp_t *lsp) kernel_lsp_pass_fail(lsp, (!ret) ? DP_DELETE_SUCCESS : DP_DELETE_FAILURE); + + return DP_REQUEST_SUCCESS; } int mpls_kernel_init(void) |