aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2024-06-12 14:04:45 +0200
committerBenoît Ganne <bganne@cisco.com>2025-02-05 15:25:13 +0100
commitb02e93846122501b0eb6e5a43cce05fc670f8b3b (patch)
treecd541d6d6228bf40c00f34423bf5c3d96a6ad93e
parent41392c5e2fca3a46cc967288ccb1e8c368727ca9 (diff)
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 <bganne@cisco.com>
-rw-r--r--src/plugins/cnat/cnat_snat_policy.c5
1 files changed, 3 insertions, 2 deletions
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)