aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-gpe
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2017-05-18 22:26:47 -0400
committerJohn Lo <loj@cisco.com>2017-05-19 13:08:49 +0000
commit9793477a28c45e4eb5bba3f2050fe415e57e8ad8 (patch)
tree8b4071fdc7e2290896d92faf4ab4668dd5f7daa8 /src/vnet/lisp-gpe
parentfa7f9fddf27efb33ab34fc7fe7fa58b1c7a240d0 (diff)
Enforce Bridge Domain ID range to match 24-bit VNI range
Enforce bridge domain ID range to allow a maximum value of 16M which matches the range of 24-bit VNI used for virtual overlay network ID. Fix "show bridge-domain" output to allow full 16M BD ID range to be displayed using 8-digit spaces. Change-Id: I80d9c76ea7c001bcccd3c19df1f3e55d2970f01c Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/lisp-gpe')
-rw-r--r--src/vnet/lisp-gpe/interface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/lisp-gpe/interface.c b/src/vnet/lisp-gpe/interface.c
index ff750563c53..94703abc4cf 100644
--- a/src/vnet/lisp-gpe/interface.c
+++ b/src/vnet/lisp-gpe/interface.c
@@ -653,6 +653,12 @@ lisp_gpe_add_l2_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id)
uword *hip, *si;
u16 bd_index;
+ if (bd_id > L2_BD_ID_MAX)
+ {
+ clib_warning ("bridge domain ID %d exceed 16M limit", bd_id);
+ return ~0;
+ }
+
bd_index = bd_find_or_add_bd_index (&bd_main, bd_id);
hip = hash_get (l2_ifaces->hw_if_index_by_dp_table, bd_index);