aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2024-04-16 09:36:05 +0200
committerNeale Ranns <neale@graphiant.com>2024-07-12 03:09:22 +0000
commitff570d3d07ebe07a5107b44d50c54fc4a57359dc (patch)
treee09554d6adf9e79b5d9abc7b9357509db20d8641 /src/vnet/interface_api.c
parentcaaa63322307b28bc8cf9796f642d9a068722ba5 (diff)
fib: make mfib optional
In some cases we do not need multicast support. Making it optional helps scaling to high number of VRFs, by reducing the control plane operations and memory consumption. Type: improvement Change-Id: Ib34ed3fe2806e2f4624981da4e4a3c49c69f70be Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index c727e519138..69bf4b72ba4 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -579,7 +579,7 @@ ip_table_bind (fib_protocol_t fproto, u32 sw_if_index, u32 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)
+ if (~0 == fib_index)
{
return (VNET_API_ERROR_NO_SUCH_FIB);
}
@@ -601,7 +601,8 @@ ip_table_bind (fib_protocol_t fproto, u32 sw_if_index, u32 table_id)
/* clang-format on */
fib_table_bind (fproto, sw_if_index, fib_index);
- mfib_table_bind (fproto, sw_if_index, mfib_index);
+ if (mfib_index != ~0)
+ mfib_table_bind (fproto, sw_if_index, mfib_index);
return (0);
}