diff options
author | Klement Sekera <ksekera@cisco.com> | 2019-12-18 12:17:06 +0000 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-04-24 09:54:47 +0000 |
commit | c99c0250a55ae6d4f02292e94d7b48589f8da4ce (patch) | |
tree | 383826431a2f11bcb106d48d93a7723e8b0410ef /src/vnet/ip/reass/ip4_full_reass.c | |
parent | ec40a7d2bce4bba67af3b3d971547d40e90fdf97 (diff) |
ip: reassembly: improve type safety
Type: refactor
Change-Id: Ib2d4a11ffa0e1e56ca05705ba8cdf84e6cc66427
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/ip/reass/ip4_full_reass.c')
-rw-r--r-- | src/vnet/ip/reass/ip4_full_reass.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vnet/ip/reass/ip4_full_reass.c b/src/vnet/ip/reass/ip4_full_reass.c index 94136ff487c..0828d3b0e47 100644 --- a/src/vnet/ip/reass/ip4_full_reass.c +++ b/src/vnet/ip/reass/ip4_full_reass.c @@ -480,8 +480,7 @@ again: reass = NULL; now = vlib_time_now (vm); - if (!clib_bihash_search_16_8 - (&rm->hash, (clib_bihash_kv_16_8_t *) kv, (clib_bihash_kv_16_8_t *) kv)) + if (!clib_bihash_search_16_8 (&rm->hash, &kv->kv, &kv->kv)) { reass = pool_elt_at_index (rm->per_thread_data @@ -523,14 +522,13 @@ again: ++rt->reass_n; } - reass->key.as_u64[0] = ((clib_bihash_kv_16_8_t *) kv)->key[0]; - reass->key.as_u64[1] = ((clib_bihash_kv_16_8_t *) kv)->key[1]; + reass->key.as_u64[0] = kv->kv.key[0]; + reass->key.as_u64[1] = kv->kv.key[1]; kv->v.reass_index = (reass - rt->pool); kv->v.memory_owner_thread_index = vm->thread_index; reass->last_heard = now; - int rv = - clib_bihash_add_del_16_8 (&rm->hash, (clib_bihash_kv_16_8_t *) kv, 2); + int rv = clib_bihash_add_del_16_8 (&rm->hash, &kv->kv, 2); if (rv) { ip4_full_reass_free_ctx (rt, reass); |