-
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: update routing table information for all dodags #2607
rpl: update routing table information for all dodags #2607
Conversation
88f760a
to
541352a
Compare
541352a
to
4f213f6
Compare
needs rebasing |
@OlegHahm according to github this PR can be automatically merged 😕 |
But cgundogan@d7722c1 which is part of this PR got already merged, didn't it? |
ah, you are right. will rebase |
4f213f6
to
dbe86b7
Compare
rebased to current master |
@OlegHahm any objection? |
} | ||
else { | ||
rt[i].lifetime = rt[i].lifetime - RPL_LIFETIME_STEP; | ||
for (uint8_t i = 0; i < rpl_max_routing_entries; i++) { |
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.
This should be outside the DODAG iteration
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.
Good catch, I will update and rebase this PR
dbe86b7
to
95a28f9
Compare
addressed @BytesGalore comment. Rebased |
9f184dd
to
45554bf
Compare
ping @OlegHahm @BytesGalore @gebart . any ACKs? The change is small but it's important to handle the lifetimes of multiple dodags. Otherwise only the dodag's lifetime gets decreased, which is returned by |
if (rt[i].lifetime <= 1) { | ||
memset(&rt[i], 0, sizeof(rt[i])); | ||
for (my_dodag = rpl_dodags, end = my_dodag + RPL_MAX_DODAGS; my_dodag < end; my_dodag++) { | ||
if (my_dodag->used) { |
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.
Just for my curiosity, is this check needed?
When the node joins a DODAG the value is set and never touched again (if I'm not missed something).
I can't find any occurrences where the ->used
entry of a DODAG is set to 0.
update: I know that this value is initialized with 0 but maybe we can find a way to rip this member entry
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.
Currently we do not really support a proper way of leaving a dodag. But this will change with subsequent PRs. The idea of this check is to ignore all dodags, which are stored in memory (as left-overs) and only handle the active ones.
From the code side it looks good, and works for at least one DODAG (I assume it will also work for multiple DODAGS) 👍, so ACK from my side |
|
||
if (my_dodag != NULL) { | ||
rt = rpl_get_routing_table(); | ||
for (uint8_t i = 0; i < rpl_max_routing_entries; i++) { |
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.
You could change the uint8_t
to unsigned int
while you're at it.
95a28f9
to
ee1dd43
Compare
rebased and addressed @OlegHahm's comment |
for (my_dodag = rpl_dodags, end = my_dodag + RPL_MAX_DODAGS; my_dodag < end; my_dodag++) { | ||
if (my_dodag->used) { | ||
/* Parent is NULL for root too */ | ||
if (my_dodag->my_preferred_parent != NULL) { |
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.
if ((my_dodag->used) && (my_dodag->my_preferred_parent != NULL)) {
saves a level of indentation.
26c0272
to
5557778
Compare
addressed @OlegHahm's comment and combined both |
ACK. Please squash. |
5557778
to
d27cd45
Compare
squashed |
My ACK holds, when travis is happy merge at will |
travis is happy => GO |
…odags rpl: update routing table information for all dodags
In the current implementation only the
default
dodag's routing table information is updated periodically. This PR extends this to iterate over all useddodags
instead.