aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
authorDmitry Valter <d-valter@yandex-team.ru>2022-02-22 06:40:22 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2022-02-23 10:16:51 +0000
commitd3ba1767743d3b6f9d591fd59cc8f401d8fccbf3 (patch)
tree40e520a60c3c6bbc41cf5d260993a481e277f5fc /src/vnet/fib
parent8cd5a1a1e088ee6b2ca7e0b7fffa6a4912af2780 (diff)
fib: fix mpls db label overflow
mpls fib DB size was 2^20 instead of intended 2^21. Therefore large mpls labels caused DB to overflow and write to other tables or some random objects. Or crash with ASAN. Sometimes. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru> Change-Id: I6db65680037a266fe47e8213464a0c16de63c06c (cherry picked from commit cf2595dfc0b446dd9bd5311d972cfb53b5567df8)
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/mpls_fib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/fib/mpls_fib.h b/src/vnet/fib/mpls_fib.h
index e7ea5d583d1..e9fee9990ac 100644
--- a/src/vnet/fib/mpls_fib.h
+++ b/src/vnet/fib/mpls_fib.h
@@ -31,7 +31,7 @@
* Type exposure is to allow the DP fast/inlined access
*/
#define MPLS_FIB_KEY_SIZE 21
-#define MPLS_FIB_DB_SIZE (1 << (MPLS_FIB_KEY_SIZE-1))
+#define MPLS_FIB_DB_SIZE (1 << MPLS_FIB_KEY_SIZE)
/**
* There are no options for controlling the MPLS flow hash,