-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpl: remove rpl_get_my_dodag() dependency in rpl_delete_all_parents() #2633
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,7 @@ void rpl_leave_dodag(rpl_dodag_t *dodag) | |
{ | ||
dodag->joined = 0; | ||
dodag->my_preferred_parent = NULL; | ||
rpl_delete_all_parents(); | ||
rpl_delete_all_parents(dodag); | ||
trickle_stop(&dodag->trickle); | ||
vtimer_remove(&dodag->dao_timer); | ||
} | ||
|
@@ -204,13 +204,9 @@ rpl_parent_t *rpl_find_parent(rpl_dodag_t *dodag, ipv6_addr_t *address) | |
|
||
void rpl_delete_parent(rpl_parent_t *parent) | ||
{ | ||
rpl_dodag_t *my_dodag = rpl_get_my_dodag(); | ||
|
||
if ((my_dodag != NULL) && rpl_equal_id(&my_dodag->my_preferred_parent->addr, | ||
&parent->addr)) { | ||
my_dodag->my_preferred_parent = NULL; | ||
if (parent == parent->dodag->my_preferred_parent) { | ||
parent->dodag->my_preferred_parent = NULL; | ||
} | ||
|
||
memset(parent, 0, sizeof(*parent)); | ||
} | ||
|
||
|
@@ -235,16 +231,15 @@ void rpl_delete_worst_parent(void) | |
|
||
} | ||
|
||
void rpl_delete_all_parents(void) | ||
void rpl_delete_all_parents(rpl_dodag_t *dodag) | ||
{ | ||
rpl_dodag_t *my_dodag = rpl_get_my_dodag(); | ||
|
||
if (my_dodag != NULL) { | ||
my_dodag->my_preferred_parent = NULL; | ||
} | ||
|
||
dodag->my_preferred_parent = NULL; | ||
for (int i = 0; i < RPL_MAX_PARENTS; i++) { | ||
memset(&parents[i], 0, sizeof(parents[i])); | ||
if (parents[i].dodag && (dodag->instance->id == parents[i].dodag->instance->id) && | ||
(!memcmp(&dodag->dodag_id, &parents[i].dodag->dodag_id, sizeof(ipv6_addr_t)))) { | ||
memset(&parents[i], 0, sizeof(parents[i])); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this must be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👓 sorry, somehow missed that line |
||
} | ||
} | ||
} | ||
|
||
|
@@ -401,7 +396,8 @@ void rpl_global_repair(rpl_dodag_t *my_dodag, ipv6_addr_t *p_addr, uint16_t rank | |
return; | ||
} | ||
|
||
rpl_delete_all_parents(); | ||
rpl_delete_all_parents(my_dodag); | ||
my_dodag->version = my_dodag->version; | ||
my_dodag->dtsn++; | ||
my_dodag->my_preferred_parent = rpl_new_parent(my_dodag, p_addr, rank); | ||
|
||
|
@@ -433,7 +429,7 @@ void rpl_local_repair(rpl_dodag_t *my_dodag) | |
|
||
my_dodag->my_rank = INFINITE_RANK; | ||
my_dodag->dtsn++; | ||
rpl_delete_all_parents(); | ||
rpl_delete_all_parents(my_dodag); | ||
trickle_reset_timer(&my_dodag->trickle); | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cgundogan I assume that
rpl_equal_id(...)
is obsolete/wrong in the RPL implementation since we now provide multiple DODAGs?