summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-12-10 12:44:46 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-12 07:43:14 +0000
commitd8e41e7810d453396c49321d28d0d73b3b50c09b (patch)
treea59ba07c9aa74871ceffa4680a1be58235ef014f /src
parent280079fb99f25b992c33b3372955b2af9fc9c30b (diff)
classify: forbid invalid match config
Forbid too long match to be configured. Type: fix Change-Id: Icfced0f86821d5febd6a3c81e1315bd9737498c0 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 71a70d73f34f7c057dd95dbca39fb8e602087a75)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/vnet/classify/vnet_classify.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/classify/vnet_classify.c b/src/vnet/classify/vnet_classify.c
index a35ec1b14d8..f98429e070d 100755
--- a/src/vnet/classify/vnet_classify.c
+++ b/src/vnet/classify/vnet_classify.c
@@ -775,6 +775,9 @@ vnet_classify_add_del_table (vnet_classify_main_t * cm,
if (nbuckets == 0)
return VNET_API_ERROR_INVALID_VALUE;
+ if (match < 1 || match > 5)
+ return VNET_API_ERROR_INVALID_VALUE;
+
t = vnet_classify_new_table (cm, mask, nbuckets, memory_size,
skip, match);
t->next_table_index = next_table_index;