summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_fib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/l2/l2_fib.c')
-rw-r--r--src/vnet/l2/l2_fib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c
index 6f8f6e06330..4ed16987404 100644
--- a/src/vnet/l2/l2_fib.c
+++ b/src/vnet/l2/l2_fib.c
@@ -413,6 +413,13 @@ l2fib_add (vlib_main_t * vm,
}
}
+ if (vec_len (l2input_main.configs) <= sw_if_index)
+ {
+ error = clib_error_return (0, "Interface sw_if_index %d not in L2 mode",
+ sw_if_index);
+ goto done;
+ }
+
if (filter_mac)
l2fib_add_filter_entry (mac, bd_index);
else