Skip to content

Commit

Permalink
Merge pull request #5267 from cgundogan/pr/gnrc_rpl/reduce_scope_now
Browse files Browse the repository at this point in the history
gnrc_rpl: reduce scope of now
  • Loading branch information
miri64 committed Apr 22, 2016
2 parents bf135c4 + 6f9d3a1 commit b8787b6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c
Expand Up @@ -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)
{
uint32_t now = xtimer_now();

/* update Parent lifetime */
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
if (dodag->instance->mop != GNRC_RPL_P2P_MOP) {
#endif
Expand Down

0 comments on commit b8787b6

Please sign in to comment.