From 3ce7bcb55b8bdf53aa4975a6312a5fd4a1ca2d0c Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Wed, 22 Nov 2017 02:49:13 -0800 Subject: CLI for interface MPLS enable returns errors to caller Change-Id: I9eef6fb9d050552f0759080ea645b885d5b9cc12 Signed-off-by: Neale Ranns --- src/vnet/mpls/interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vnet/mpls/interface.c b/src/vnet/mpls/interface.c index d7c8e7d340e..c792d56b12e 100644 --- a/src/vnet/mpls/interface.c +++ b/src/vnet/mpls/interface.c @@ -90,6 +90,7 @@ mpls_interface_enable_disable (vlib_main_t * vm, vnet_main_t * vnm = vnet_get_main(); clib_error_t * error = 0; u32 sw_if_index, enable; + int rv; sw_if_index = ~0; @@ -111,7 +112,10 @@ mpls_interface_enable_disable (vlib_main_t * vm, goto done; } - mpls_sw_interface_enable_disable(&mpls_main, sw_if_index, enable, 0); + rv = mpls_sw_interface_enable_disable(&mpls_main, sw_if_index, enable, 0); + + if (VNET_API_ERROR_NO_SUCH_FIB == rv) + error = clib_error_return (0, "default MPLS table must be created first"); done: return error; -- cgit 1.2.3-korg