From: Benoît Ganne Date: Wed, 12 Jun 2024 12:04:45 +0000 (+0200) Subject: cnat: fix interface map type unformat X-Git-Tag: v25.10-rc0~229 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F41143%2F5;p=vpp.git cnat: fix interface map type unformat C enum is not guaranteed to be 8-bit (and in general it is not, it's 32-bits by default in GCC for example). Type: fix Change-Id: I6a10f85991ae1903fb9f4aeebfcfdf5315200903 Signed-off-by: Benoît Ganne --- diff --git a/src/plugins/cnat/cnat_snat_policy.c b/src/plugins/cnat/cnat_snat_policy.c index cd9bfef492a..5f15b7d26c9 100644 --- a/src/plugins/cnat/cnat_snat_policy.c +++ b/src/plugins/cnat/cnat_snat_policy.c @@ -22,7 +22,8 @@ cnat_snat_policy_main_t cnat_snat_policy_main; uword unformat_cnat_snat_interface_map_type (unformat_input_t *input, va_list *args) { - u8 *a = va_arg (*args, u8 *); + cnat_snat_interface_map_type_t *a = + va_arg (*args, cnat_snat_interface_map_type_t *); if (unformat (input, "include-v4")) *a = CNAT_SNAT_IF_MAP_INCLUDE_V4; else if (unformat (input, "include-v6")) @@ -113,7 +114,7 @@ cnat_snat_policy_add_del_if_command_fn (vlib_main_t *vm, vnet_main_t *vnm = vnet_get_main (); int is_add = 1; u32 sw_if_index = ~0; - u32 table = 0; + cnat_snat_interface_map_type_t table = CNAT_SNAT_IF_MAP_INCLUDE_V4; int rv; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)