diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-11-22 21:26:20 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-12-14 09:15:48 +0000 |
commit | 9b7e8acf792cced80e6775bc5668d9db415cdb46 (patch) | |
tree | b600764a60f9978017a567390a025d2777b864a1 /src/vnet/ip/ip_api.c | |
parent | 755042dec0fcc733d456adc2a74042c529eff039 (diff) |
api: verify message size on receipt
When a message is received, verify that it's sufficiently large to
accomodate any VLAs within message. To do that, we need a way to
calculate message size including any VLAs. This patch adds such
funcionality to vppapigen and necessary C code to use those to validate
message size on receipt. Drop messages which are malformed.
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2903aa21dee84be6822b064795ba314de46c18f4
Diffstat (limited to 'src/vnet/ip/ip_api.c')
-rw-r--r-- | src/vnet/ip/ip_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c index e197057d8c5..b1b7ff3a7ae 100644 --- a/src/vnet/ip/ip_api.c +++ b/src/vnet/ip/ip_api.c @@ -514,7 +514,9 @@ vl_api_add_del_ip_punt_redirect_v2_t_handler ( goto out; if (0 != n_paths) - vec_validate (rpaths, n_paths - 1); + { + vec_validate (rpaths, n_paths - 1); + } for (ii = 0; ii < n_paths; ii++) { |