/* Upon reception of first fragment with respective of size and tag create a new cache. If number of unused cache are out then discard the fragments.  */
static struct frag_cache* set_reass_cache(struct net_pkt *pkt, uint16_t size, uint16_t tag)
/* Upon reception of first fragment with respective of size and tag create a new cache. If number of unused cache are out then discard the fragments.  */
static struct frag_cache* set_reass_cache(struct net_pkt *pkt, uint16_t size, uint16_t tag)
{
	int i;
	for (i = 0; i < REASS_CACHE_SIZE; i++) {
		if (cache[i].used) {
			continue;
		}
		cache[i].pkt = pkt;
		cache[i].size = size;
		cache[i].tag = tag;
		cache[i].used = true;
		k_work_init_delayable(&cache[i].timer, reass_timeout);
		k_work_reschedule(&cache[i].timer, FRAG_REASSEMBLY_TIMEOUT);
		return &cache[i];
	}
	return NULL;
}