aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_reassembly.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip/ip6_reassembly.c')
-rw-r--r--src/vnet/ip/ip6_reassembly.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/vnet/ip/ip6_reassembly.c b/src/vnet/ip/ip6_reassembly.c
index 1be5b5ef546..8b199f39ced 100644
--- a/src/vnet/ip/ip6_reassembly.c
+++ b/src/vnet/ip/ip6_reassembly.c
@@ -926,10 +926,13 @@ ip6_reassembly_inline (vlib_main_t * vm,
b0 = vlib_get_buffer (vm, bi0);
ip6_header_t *ip0 = vlib_buffer_get_current (b0);
- ip6_frag_hdr_t *frag_hdr;
+ ip6_frag_hdr_t *frag_hdr = NULL;
ip6_ext_header_t *prev_hdr;
- ip6_ext_header_find_t (ip0, prev_hdr, frag_hdr,
- IP_PROTOCOL_IPV6_FRAGMENTATION);
+ if (ip6_ext_hdr (ip0->protocol))
+ {
+ ip6_ext_header_find_t (ip0, prev_hdr, frag_hdr,
+ IP_PROTOCOL_IPV6_FRAGMENTATION);
+ }
if (!frag_hdr)
{
// this is a regular packet - no fragmentation
@@ -1146,8 +1149,7 @@ ip6_reass_set (u32 timeout_ms, u32 max_reassemblies,
ip6_reass_main.ip6_reass_expire_node_idx,
IP6_EVENT_CONFIG_CHANGED, 0);
u32 new_nbuckets = ip6_reass_get_nbuckets ();
- if (ip6_reass_main.max_reass_n > 0 && new_nbuckets > 1 &&
- new_nbuckets != old_nbuckets)
+ if (ip6_reass_main.max_reass_n > 0 && new_nbuckets > old_nbuckets)
{
clib_bihash_48_8_t new_hash;
memset (&new_hash, 0, sizeof (new_hash));
@@ -1206,6 +1208,10 @@ ip6_reass_init_function (vlib_main_t * vm)
ASSERT (node);
rm->ip6_reass_expire_node_idx = node->index;
+ ip6_reass_set_params (IP6_REASS_TIMEOUT_DEFAULT_MS,
+ IP6_REASS_MAX_REASSEMBLIES_DEFAULT,
+ IP6_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS);
+
nbuckets = ip6_reass_get_nbuckets ();
clib_bihash_init_48_8 (&rm->hash, "ip6-reass", nbuckets, nbuckets * 1024);
@@ -1221,10 +1227,6 @@ ip6_reass_init_function (vlib_main_t * vm)
ip6_register_protocol (IP_PROTOCOL_IPV6_FRAGMENTATION,
ip6_reass_node.index);
- ip6_reass_set_params (IP6_REASS_TIMEOUT_DEFAULT_MS,
- IP6_REASS_MAX_REASSEMBLIES_DEFAULT,
- IP6_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS);
-
return error;
}