aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-11-06 10:51:47 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-11-12 12:33:18 +0000
commit020f02cf3df0538c4712aa94d68e2b42a0949d9b (patch)
treea9a84f5b41199cdd6998a7f871076ca64a6fa404 /src/vnet
parentb2a92ff3b97c6ae5f84b48e3a77400afaeb43d29 (diff)
ipsec: fix unformat types
ipsec_{crypto,integ}_alg_t are packed and smaller than u32. Callers are using those enums so unformat functions should too instead of u32 to not overflow the stack. Type: fix Change-Id: Ifc86366f1928ca6352f06f390a88ac64668289d5 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit f6422ffbc82c55f50d06c8c7a2e230db7001ee35)
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ipsec/ipsec_format.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index e3c6f22bf00..f365d0cd620 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -95,7 +95,7 @@ format_ipsec_crypto_alg (u8 * s, va_list * args)
uword
unformat_ipsec_crypto_alg (unformat_input_t * input, va_list * args)
{
- u32 *r = va_arg (*args, u32 *);
+ ipsec_crypto_alg_t *r = va_arg (*args, ipsec_crypto_alg_t *);
if (0);
#define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_CRYPTO_ALG_##f;
@@ -127,7 +127,7 @@ format_ipsec_integ_alg (u8 * s, va_list * args)
uword
unformat_ipsec_integ_alg (unformat_input_t * input, va_list * args)
{
- u32 *r = va_arg (*args, u32 *);
+ ipsec_integ_alg_t *r = va_arg (*args, ipsec_integ_alg_t *);
if (0);
#define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_INTEG_ALG_##f;