summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
authorGavril Florian <gflorian@3nets.io>2023-06-15 18:39:57 +0000
committerDamjan Marion <dmarion@0xa5.net>2023-10-01 20:59:58 +0000
commite7f34c93b1c928855f88896c5bdd2bc539ee77ae (patch)
treeded9269a70adbc6dde267312243c281a53b4134c /src/vnet/fib
parent35f8ee6921f3995c12502c352d25487c6a6fc290 (diff)
fib: Crash when specify a big prefix length from CLI.
The VPP is crashing when specify a very big prefix length, like ip route add 1.1.1.1/55 via 2.2.2.2 Type: fix Signed-off-by: Gavril Florian <gflorian@3nets.io> Change-Id: Ic491c0b24e07be897ff35ae1e835280f04ab3ea5
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c
index c8511c08eba..07d6699d87a 100644
--- a/src/vnet/fib/fib_api.c
+++ b/src/vnet/fib/fib_api.c
@@ -448,6 +448,9 @@ fib_api_route_add_del (u8 is_add,
fib_entry_flag_t entry_flags,
fib_route_path_t *rpaths)
{
+ if (!fib_prefix_validate(prefix)) {
+ return (VNET_API_ERROR_INVALID_PREFIX_LENGTH);
+ }
if (is_multipath)
{
if (vec_len(rpaths) == 0)