Skip to content
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 unnecessary check for multiple instances #2606

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions sys/net/routing/rpl/rpl_control_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,35 +523,15 @@ void rpl_recv_DIO(void)
int len = DIO_BASE_LEN;

rpl_instance_t *dio_inst = rpl_get_instance(rpl_dio_buf->rpl_instanceid);
rpl_instance_t *my_inst = rpl_get_my_instance();

if (dio_inst == NULL) {
if (my_inst != NULL) {
/* already part of a DODAG -> impossible to join other instance */
DEBUGF("Not joining another DODAG!\n");
return;
}

dio_inst = rpl_new_instance(rpl_dio_buf->rpl_instanceid);

if (dio_inst == NULL) {
DEBUGF("Failed to create a new RPL instance!\n");
return;
}
}
else if (my_inst == NULL) {
DEBUGF("Not joined an instance yet\n");
}
else if (my_inst->id != dio_inst->id) {
/* TODO: Add support support for several instances. */

/* At the moment, nodes can only join one instance, this is
* the instance they join first.
* Instances cannot be switched later on. */

DEBUGF("Ignoring instance - we are %d and got %d\n", my_inst->id, dio_inst->id);
return;
}

rpl_dodag_t dio_dodag;
memset(&dio_dodag, 0, sizeof(dio_dodag));
Expand Down