Refuse to allocate more parents for a specific DAG when the per-DAG limit has been reached.
This commit is contained in:
parent
d3fee514b3
commit
ed37e983f6
1 changed files with 4 additions and 0 deletions
|
@ -469,6 +469,10 @@ rpl_add_parent(rpl_dag_t *dag, rpl_dio_t *dio, uip_ipaddr_t *addr)
|
|||
{
|
||||
rpl_parent_t *p;
|
||||
|
||||
if(RPL_PARENT_COUNT(dag) == RPL_MAX_PARENTS_PER_DAG) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = memb_alloc(&parent_memb);
|
||||
if(p == NULL) {
|
||||
RPL_STAT(rpl_stats.mem_overflows++);
|
||||
|
|
Loading…
Reference in a new issue