summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_reassembly.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-02-05 09:45:43 -0500
committerFlorin Coras <florin.coras@gmail.com>2018-02-05 16:09:31 +0000
commit1403fcd7ec2da72334f5df20f0b7e6dbba24d856 (patch)
treeb4bbf1a7050a531823f02a99523be42285cac39e /src/vnet/ip/ip6_reassembly.c
parent21c8baf9a77b49af3dd54a7f64ce34dc932f10c3 (diff)
Fix ip4/6_reass_main.ip4/6_reass_expire_node_idx used before set
Add an ASSERT to vlib_process_signal_event_helper to catch future instances of passing node_index = 0 to vlib_process_signal_event(). Change-Id: Iec896fc7c3917feb2fd3198cea42851ba88e64e5 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/ip/ip6_reassembly.c')
-rw-r--r--src/vnet/ip/ip6_reassembly.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/ip/ip6_reassembly.c b/src/vnet/ip/ip6_reassembly.c
index 5a7c081055b..df9c4fbcdf8 100644
--- a/src/vnet/ip/ip6_reassembly.c
+++ b/src/vnet/ip/ip6_reassembly.c
@@ -1064,12 +1064,18 @@ ip6_reass_init_function (vlib_main_t * vm)
ip6_reass_main_t *rm = &ip6_reass_main;
clib_error_t *error = 0;
u32 nbuckets;
+ vlib_node_t *node;
rm->vlib_main = vm;
rm->vnet_main = vnet_get_main ();
rm->reass_n = 0;
pool_alloc (rm->pool, rm->max_reass_n);
+
+ node = vlib_get_node_by_name (vm, (u8 *) "ip6-reassembly-expire-walk");
+ ASSERT (node);
+ rm->ip6_reass_expire_node_idx = node->index;
+
ip6_reass_set (IP6_REASS_TIMEOUT_DEFAULT_MS,
IP6_REASS_MAX_REASSEMBLIES_DEAFULT,
IP6_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS);
@@ -1077,12 +1083,9 @@ ip6_reass_init_function (vlib_main_t * vm)
nbuckets = ip6_reass_get_nbuckets ();
clib_bihash_init_48_8 (&rm->hash, "ip6-reass", nbuckets, nbuckets * 1024);
- vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "ip6-drop");
+ node = vlib_get_node_by_name (vm, (u8 *) "ip6-drop");
ASSERT (node);
rm->ip6_drop_idx = node->index;
- node = vlib_get_node_by_name (vm, (u8 *) "ip6-reassembly-expire-walk");
- ASSERT (node);
- rm->ip6_reass_expire_node_idx = node->index;
node = vlib_get_node_by_name (vm, (u8 *) "ip6-icmp-error");
ASSERT (node);
rm->ip6_icmp_error_idx = node->index;