1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gnrc_rpl: reduce scope of now

This commit is contained in:
Cenk Gündoğan 2016-04-08 19:53:14 +02:00
parent 040ad55f62
commit 6f9d3a15ac

View File

@ -264,11 +264,10 @@ void gnrc_rpl_local_repair(gnrc_rpl_dodag_t *dodag)
void gnrc_rpl_parent_update(gnrc_rpl_dodag_t *dodag, gnrc_rpl_parent_t *parent) void gnrc_rpl_parent_update(gnrc_rpl_dodag_t *dodag, gnrc_rpl_parent_t *parent)
{ {
uint32_t now = xtimer_now();
/* update Parent lifetime */ /* update Parent lifetime */
if (parent != NULL) { if (parent != NULL) {
parent->lifetime = (now / SEC_IN_USEC) + ((dodag->default_lifetime * dodag->lifetime_unit)); uint32_t now = xtimer_now();
parent->lifetime = (now / SEC_IN_USEC) + (dodag->default_lifetime * dodag->lifetime_unit);
#ifdef MODULE_GNRC_RPL_P2P #ifdef MODULE_GNRC_RPL_P2P
if (dodag->instance->mop != GNRC_RPL_P2P_MOP) { if (dodag->instance->mop != GNRC_RPL_P2P_MOP) {
#endif #endif