summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-05-17 06:34:24 -0700
committerDave Barach <openvpp@barachs.net>2018-05-18 12:15:27 +0000
commit8f6dd328b2188eb15ad839b39cb31530758a4be1 (patch)
treebc889d0a658280f9c026637a532fa831b9c741a4 /src/vnet/interface_api.c
parent1f6e9288536ee30db3911ccea1ea10af4b6b3e5e (diff)
IP table bind allowed only if table exists
Change-Id: If01400e3434b25b2da36ba28ceb8444b216d0e38 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 8d982e36b73..9a1838fa321 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -382,30 +382,15 @@ ip_table_bind (fib_protocol_t fproto,
}
/*
- * This is temporary whilst I do the song and dance with the CSIT version
- */
- if (0 != table_id)
- {
- fib_index = fib_table_find_or_create_and_lock (fproto, table_id, src);
- mfib_index =
- mfib_table_find_or_create_and_lock (fproto, table_id, msrc);
- }
- else
- {
- fib_index = 0;
- mfib_index = 0;
- }
-
- /*
* This if table does not exist = error is what we want in the end.
*/
- /* fib_index = fib_table_find (fproto, table_id); */
- /* mfib_index = mfib_table_find (fproto, table_id); */
+ fib_index = fib_table_find (fproto, table_id);
+ mfib_index = mfib_table_find (fproto, table_id);
- /* if (~0 == fib_index || ~0 == mfib_index) */
- /* { */
- /* return (VNET_API_ERROR_NO_SUCH_FIB); */
- /* } */
+ if (~0 == fib_index || ~0 == mfib_index)
+ {
+ return (VNET_API_ERROR_NO_SUCH_FIB);
+ }
if (FIB_PROTOCOL_IP6 == fproto)
{
@@ -513,15 +498,6 @@ ip_table_bind (fib_protocol_t fproto,
ip4_main.mfib_index_by_sw_if_index[sw_if_index] = mfib_index;
}
- /*
- * Temporary. undo the locks from the find and create at the staart
- */
- if (0 != table_id)
- {
- fib_table_unlock (fib_index, fproto, src);
- mfib_table_unlock (mfib_index, fproto, msrc);
- }
-
return (0);
}