aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/snat_api.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-07-11 03:55:02 -0700
committerOle Trøan <otroan@employees.org>2017-08-16 08:36:43 +0000
commitf8cd5817442f3a191befb3242a2c0c9bdd927ce0 (patch)
tree5836120f7430572c122cfe15e98a948d2424202f /src/plugins/snat/snat_api.c
parent6d5c4cdbcc4799a9f43df68df434d5786db44b45 (diff)
NAT64: Fallback to 3-tuple key for non TCP/UDP sessions (VPP-884)
Change-Id: I4cafc8291725feb499355092bd429433e649b5b2 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/snat/snat_api.c')
-rw-r--r--src/plugins/snat/snat_api.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/plugins/snat/snat_api.c b/src/plugins/snat/snat_api.c
index ee623d266d7..227074f9cb4 100644
--- a/src/plugins/snat/snat_api.c
+++ b/src/plugins/snat/snat_api.c
@@ -1580,7 +1580,7 @@ nat64_api_bib_walk (nat64_db_bib_entry_t * bibe, void *arg)
rmp->i_port = bibe->in_port;
rmp->o_port = bibe->out_port;
rmp->vrf_id = ntohl (fib->ft_table_id);
- rmp->proto = snat_proto_to_ip_proto (bibe->proto);
+ rmp->proto = bibe->proto;
rmp->is_static = bibe->is_static;
rmp->ses_num = ntohl (bibe->ses_num);
@@ -1594,7 +1594,6 @@ vl_api_nat64_bib_dump_t_handler (vl_api_nat64_bib_dump_t * mp)
{
unix_shared_memory_queue_t *q;
nat64_main_t *nm = &nat64_main;
- snat_protocol_t proto;
if (nm->is_disabled)
return;
@@ -1608,9 +1607,7 @@ vl_api_nat64_bib_dump_t_handler (vl_api_nat64_bib_dump_t * mp)
.context = mp->context,
};
- proto = ip_proto_to_snat_proto (mp->proto);
-
- nat64_db_bib_walk (&nm->db, proto, nat64_api_bib_walk, &ctx);
+ nat64_db_bib_walk (&nm->db, mp->proto, nat64_api_bib_walk, &ctx);
}
static void *
@@ -1729,7 +1726,7 @@ nat64_api_st_walk (nat64_db_st_entry_t * ste, void *arg)
clib_memcpy (rmp->or_addr, &(ste->out_r_addr), 4);
rmp->il_port = ste->r_port;
rmp->vrf_id = ntohl (fib->ft_table_id);
- rmp->proto = snat_proto_to_ip_proto (ste->proto);
+ rmp->proto = ste->proto;
vl_msg_api_send_shmem (ctx->q, (u8 *) & rmp);
@@ -1741,7 +1738,6 @@ vl_api_nat64_st_dump_t_handler (vl_api_nat64_st_dump_t * mp)
{
unix_shared_memory_queue_t *q;
nat64_main_t *nm = &nat64_main;
- snat_protocol_t proto;
if (nm->is_disabled)
return;
@@ -1755,9 +1751,7 @@ vl_api_nat64_st_dump_t_handler (vl_api_nat64_st_dump_t * mp)
.context = mp->context,
};
- proto = ip_proto_to_snat_proto (mp->proto);
-
- nat64_db_st_walk (&nm->db, proto, nat64_api_st_walk, &ctx);
+ nat64_db_st_walk (&nm->db, mp->proto, nat64_api_st_walk, &ctx);
}
static void *