-
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
rpl: remove rpl_get_my_dodag() dependency in rpl_delete_all_parents() #2633
Conversation
Rational? |
In the current implementation |
@@ -207,13 +207,9 @@ rpl_parent_t *rpl_find_parent(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, |
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?
9f184dd
to
45554bf
Compare
33a77e6
to
aa09faa
Compare
rebased to current master |
|
Did you test it? |
@OlegHahm only a function test for |
for (int i = 0; i < RPL_MAX_PARENTS; i++) { | ||
memset(&parents[i], 0, sizeof(parents[i])); | ||
if (dodag->instance->id == parents[i].dodag->instance->id && |
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.
@OlegHahm @cgundogan found it,
@cgundogan could you add a check if the specific parent has a DODAG set, for instance:
if (parents[i].dodag && dodag->instance->id == parents[i].dodag->instance->id &&
Now iterating over the parents without a set DODAG will crash on access ->instance...
I filled up the parent array manually with parent structs containing a valid DODAG. Sorry for that, the test was frivolous. |
aa09faa
to
19c2ab8
Compare
addressed @BytesGalore's comment and included a check if a parent's Dodag is set |
nice thx, 👍 if travis gets happy I will revive my ACK |
kicked travis |
and again |
Nice, my ACK is back |
huh? forgot to merge -> GO |
…rom_parent_delete rpl: remove rpl_get_my_dodag() dependency in rpl_delete_all_parents()
This PR removes the call to
rpl_get_my_dodag()
inrpl_delete_all_parents()
.Furthermore, there are minor changes to the logic whether to delete a parent or not.