summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed_in2out.c')
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_in2out.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_in2out.c b/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
index 53b1eaecc05..0e330e17b36 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
@@ -106,14 +106,13 @@ format_nat_in2out_ed_trace (u8 * s, va_list * args)
* @param rt NAT runtime data
* @param sw_if_index0 index of the inside interface
* @param ip0 IPv4 header
- * @param proto0 NAT protocol
* @param rx_fib_index0 RX FIB index
*
* @returns 0 if packet should be translated otherwise 1
*/
static inline int
snat_not_translate_fast (snat_main_t *sm, vlib_node_runtime_t *node,
- u32 sw_if_index0, ip4_header_t *ip0, u32 proto0,
+ u32 sw_if_index0, ip4_header_t *ip0,
u32 rx_fib_index0)
{
fib_node_index_t fei = FIB_NODE_INDEX_INVALID;
@@ -233,7 +232,7 @@ nat_ed_alloc_addr_and_port (snat_main_t *sm, u32 rx_fib_index, u32 nat_proto,
if (vec_len (sm->addresses) > 0)
{
- int s_addr_offset = s_addr.as_u32 % vec_len (sm->addresses);
+ u32 s_addr_offset = s_addr.as_u32 % vec_len (sm->addresses);
for (i = s_addr_offset; i < vec_len (sm->addresses); ++i)
{
@@ -557,7 +556,7 @@ static_always_inline int
nat44_ed_not_translate (vlib_main_t *vm, snat_main_t *sm,
vlib_node_runtime_t *node, u32 sw_if_index,
vlib_buffer_t *b, ip4_header_t *ip, u32 proto,
- u32 rx_fib_index, u32 thread_index)
+ u32 rx_fib_index)
{
clib_bihash_kv_16_8_t kv, value;
@@ -584,8 +583,7 @@ nat44_ed_not_translate (vlib_main_t *vm, snat_main_t *sm,
if (sm->forwarding_enabled)
return 1;
- return snat_not_translate_fast (sm, node, sw_if_index, ip, proto,
- rx_fib_index);
+ return snat_not_translate_fast (sm, node, sw_if_index, ip, rx_fib_index);
}
static_always_inline int
@@ -736,8 +734,7 @@ icmp_in2out_ed_slow_path (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip,
icmp46_header_t *icmp, u32 sw_if_index,
u32 rx_fib_index, vlib_node_runtime_t *node,
u32 next, f64 now, u32 thread_index,
- nat_protocol_t nat_proto, snat_session_t **s_p,
- int is_multi_worker)
+ snat_session_t **s_p, int is_multi_worker)
{
vlib_main_t *vm = vlib_get_main ();
u16 checksum;
@@ -769,7 +766,7 @@ icmp_in2out_ed_slow_path (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip,
{
if (PREDICT_FALSE (nat44_ed_not_translate (vm, sm, node, sw_if_index, b,
ip, NAT_PROTOCOL_ICMP,
- rx_fib_index, thread_index)))
+ rx_fib_index)))
{
return next;
}
@@ -1359,7 +1356,7 @@ nat44_ed_in2out_slow_path_node_fn_inline (vlib_main_t *vm,
{
next[0] = icmp_in2out_ed_slow_path (
sm, b0, ip0, icmp0, rx_sw_if_index0, rx_fib_index0, node, next[0],
- now, thread_index, proto0, &s0, is_multi_worker);
+ now, thread_index, &s0, is_multi_worker);
if (NAT_NEXT_DROP != next[0] && s0 &&
NAT_ED_TRNSL_ERR_SUCCESS !=
(translation_error = nat_6t_flow_buf_translate_i2o (
@@ -1419,9 +1416,9 @@ nat44_ed_in2out_slow_path_node_fn_inline (vlib_main_t *vm,
}
else
{
- if (PREDICT_FALSE (nat44_ed_not_translate (
- vm, sm, node, rx_sw_if_index0, b0, ip0, proto0,
- rx_fib_index0, thread_index)))
+ if (PREDICT_FALSE (
+ nat44_ed_not_translate (vm, sm, node, rx_sw_if_index0, b0,
+ ip0, proto0, rx_fib_index0)))
goto trace0;
}