summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_reassembly.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-02-19 13:53:43 +0100
committerOle Trøan <otroan@employees.org>2019-02-19 15:26:55 +0000
commitcae98b72c97e1ea95e06068ae9923a5f3a21938d (patch)
tree5f98ba3671625c5e32e51fc452f31ca30274217d /src/vnet/ip/ip6_reassembly.c
parent4e633e1043e867fd24badeb0405f794793beb9a9 (diff)
reassembly: fix buffer usage counter
Change-Id: I713904f8eb2f724cb08dba494c160c14cc8b24a1 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip6_reassembly.c')
-rw-r--r--src/vnet/ip/ip6_reassembly.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vnet/ip/ip6_reassembly.c b/src/vnet/ip/ip6_reassembly.c
index d78c3ff91bf..631556efec0 100644
--- a/src/vnet/ip/ip6_reassembly.c
+++ b/src/vnet/ip/ip6_reassembly.c
@@ -315,8 +315,8 @@ ip6_reass_drop_all (vlib_main_t * vm, ip6_reass_main_t * rm,
always_inline void
ip6_reass_on_timeout (vlib_main_t * vm, vlib_node_runtime_t * node,
- ip6_reass_main_t * rm, ip6_reass_t * reass,
- u32 * icmp_bi, u32 ** vec_timeout)
+ ip6_reass_main_t * rm, ip6_reass_per_thread_t * rt,
+ ip6_reass_t * reass, u32 * icmp_bi, u32 ** vec_timeout)
{
if (~0 == reass->first_bi)
{
@@ -342,6 +342,7 @@ ip6_reass_on_timeout (vlib_main_t * vm, vlib_node_runtime_t * node,
{
reass->first_bi = vnet_buffer (b)->ip.reass.next_range_bi;
}
+ --rt->buffers_n;
icmp6_error_set_vnet_buffer (b, ICMP6_time_exceeded,
ICMP6_time_exceeded_fragment_reassembly_time_exceeded,
0);
@@ -370,7 +371,8 @@ ip6_reass_find_or_create (vlib_main_t * vm, vlib_node_runtime_t * node,
reass = pool_elt_at_index (rt->pool, value.value);
if (now > reass->last_heard + rm->timeout)
{
- ip6_reass_on_timeout (vm, node, rm, reass, icmp_bi, vec_timeout);
+ ip6_reass_on_timeout (vm, node, rm, rt, reass, icmp_bi,
+ vec_timeout);
ip6_reass_free (rm, rt, reass);
reass = NULL;
}
@@ -580,6 +582,7 @@ ip6_reass_finalize (vlib_main_t * vm, vlib_node_runtime_t * node,
clib_host_to_net_u16 (total_length + first_b->current_length -
sizeof (*ip));
vlib_buffer_chain_compress (vm, first_b, vec_drop_compress);
+ rt->buffers_n -= buf_cnt - vec_len (*vec_drop_compress);
if (PREDICT_FALSE (first_b->flags & VLIB_BUFFER_IS_TRACED))
{
ip6_reass_add_trace (vm, node, rm, reass, reass->first_bi, FINALIZE, 0);
@@ -1345,13 +1348,12 @@ ip6_reass_walk_expired (vlib_main_t * vm,
b->flags &= ~VLIB_BUFFER_IS_TRACED;
}
}
- ip6_reass_on_timeout (vm, node, rm, reass, &icmp_bi, &vec_timeout);
+ ip6_reass_on_timeout (vm, node, rm, rt, reass, &icmp_bi, &vec_timeout);
u32 after = vec_len (vec_timeout);
rt->buffers_n -= (after - before);
if (~0 != icmp_bi)
{
vec_add1 (vec_icmp_bi, icmp_bi);
- --rt->buffers_n;
}
ip6_reass_free (rm, rt, reass);
}