1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gnrc_ipv6_nib: fix caching mechanism of neighbor cache

This commit is contained in:
Martine Lenders 2017-06-13 15:51:43 +02:00
parent 58067bd489
commit b32200e3ad

View File

@ -123,19 +123,18 @@ static inline _nib_onl_entry_t *_cache_out_onl_entry(const ipv6_addr_t *addr,
res = tmp; res = tmp;
res->mode = _EMPTY; res->mode = _EMPTY;
_override_node(addr, iface, res); _override_node(addr, iface, res);
/* cstate masked above already */ /* cstate masked in _nib_nc_add() already */
res->info = cstate; res->info |= cstate;
res->mode = _NC; res->mode = _NC;
break;
} }
/* requeue if not garbage collectible at the moment */ /* requeue if not garbage collectible at the moment or queueing
DEBUG("nib: Requeing (addr = %s, iface = %u)\n", * newly created NCE */
ipv6_addr_to_str(addr_str, &tmp->ipv6,
sizeof(addr_str)),
_nib_onl_get_if(tmp));
clist_rpush(&_next_removable, (clist_node_t *)tmp); clist_rpush(&_next_removable, (clist_node_t *)tmp);
tmp = (_nib_onl_entry_t *)clist_lpop(&_next_removable); if (res == NULL) {
} while (tmp != first); /* no new entry created yet, get next entry in FIFO */
tmp = (_nib_onl_entry_t *)clist_lpop(&_next_removable);
}
} while ((tmp != first) && (res != NULL));
return res; return res;
} }