mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-23 05:23:50 +01:00
ipv6/nib: _nib_offl_clear() delete offlink entry when mode is not zero
This commit is contained in:
parent
d5d4fc869a
commit
1d3b320c2e
@ -25,6 +25,7 @@
|
|||||||
#include "net/gnrc/ipv6/nib/nc.h"
|
#include "net/gnrc/ipv6/nib/nc.h"
|
||||||
#include "net/gnrc/ipv6/nib.h"
|
#include "net/gnrc/ipv6/nib.h"
|
||||||
#include "net/gnrc/netif/internal.h"
|
#include "net/gnrc/netif/internal.h"
|
||||||
|
#include "net/ipv6/addr.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
|
||||||
#include "_nib-internal.h"
|
#include "_nib-internal.h"
|
||||||
@ -552,6 +553,7 @@ static inline bool _in_abrs(const _nib_abr_entry_t *abr)
|
|||||||
|
|
||||||
void _nib_offl_clear(_nib_offl_entry_t *dst)
|
void _nib_offl_clear(_nib_offl_entry_t *dst)
|
||||||
{
|
{
|
||||||
|
if (dst->mode == _EMPTY) {
|
||||||
if (dst->next_hop != NULL) {
|
if (dst->next_hop != NULL) {
|
||||||
_nib_offl_entry_t *ptr;
|
_nib_offl_entry_t *ptr;
|
||||||
for (ptr = _dsts; _in_dsts(ptr); ptr++) {
|
for (ptr = _dsts; _in_dsts(ptr); ptr++) {
|
||||||
@ -565,8 +567,14 @@ void _nib_offl_clear(_nib_offl_entry_t *dst)
|
|||||||
dst->next_hop->mode &= ~(_DST);
|
dst->next_hop->mode &= ~(_DST);
|
||||||
_nib_onl_clear(dst->next_hop);
|
_nib_onl_clear(dst->next_hop);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
memset(dst, 0, sizeof(_nib_offl_entry_t));
|
memset(dst, 0, sizeof(_nib_offl_entry_t));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
DEBUG("nib: offlink entry %s/%u with mode %u not cleared\n",
|
||||||
|
ipv6_addr_to_str(addr_str, &dst->pfx, sizeof(addr_str)),
|
||||||
|
dst->pfx_len, dst->mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_nib_offl_entry_t *_nib_offl_iter(const _nib_offl_entry_t *last)
|
_nib_offl_entry_t *_nib_offl_iter(const _nib_offl_entry_t *last)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user