Skip to content

Commit 45f6b27

Browse files
author
Arto Kinnunen
committed
Merge commit '8ae3f59cb8606f9db7ab1a34844710ee0cb6ebd8' into feature-wisun
* commit '8ae3f59cb8606f9db7ab1a34844710ee0cb6ebd8': Squashed 'features/nanostack/sal-stack-nanostack/' changes from d879e6d..b969fa3
2 parents aa70f68 + 8ae3f59 commit 45f6b27

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

features/nanostack/sal-stack-nanostack/source/RPL/rpl_structures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ struct rpl_instance {
179179
bool dao_in_transit: 1; /* If we have a DAO in transit */
180180
bool requested_dao_ack: 1; /* If we requested an ACK (so we retry if no ACK, rather than assuming success) */
181181
bool pending_neighbour_confirmation: 1; /* if we have not finished address registration state to parent */
182+
bool parent_was_selected: 1;
182183
uint8_t poison_count;
183184
uint8_t repair_dis_count;
184185
uint16_t repair_dis_timer;

features/nanostack/sal-stack-nanostack/source/RPL/rpl_upward.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,7 @@ void rpl_instance_run_parent_selection(rpl_instance_t *instance)
15161516
if (preferred_parent) {
15171517
// Always stop repair if we find a parent
15181518
rpl_instance_set_local_repair(instance, false);
1519+
instance->parent_was_selected = true;
15191520
//Validate time from last DIO
15201521

15211522
uint32_t time_between_parent = protocol_core_monotonic_time - preferred_parent->dio_timestamp;
@@ -1525,11 +1526,12 @@ void rpl_instance_run_parent_selection(rpl_instance_t *instance)
15251526
rpl_control_transmit_dis(instance->domain, NULL, RPL_SOLINFO_PRED_INSTANCEID, instance->id, NULL, 0, preferred_parent->ll_address);
15261527
}
15271528

1528-
} else if (original_preferred) {
1529-
// Only start repair if we just lost a parent
1529+
} else if (instance->parent_was_selected) {
1530+
// Only start repair if we just lost a parent or current rank goes to infinity
15301531
rpl_instance_set_local_repair(instance, true);
1532+
instance->parent_was_selected = false;
15311533
} else {
1532-
// !preferred_parent && !original_preferred - didn't have a parent,
1534+
// !preferred_parent && !instance->parent_was_selected - didn't have a parent,
15331535
// still don't. Leave repair flag as-is (would be off on initial start
15341536
// up, may be on if having problems mid-session).
15351537
}

0 commit comments

Comments
 (0)