Skip to content

Commit

Permalink
Bug fix: changed the macro RPL_LOLLIPOP_INCREMENT to update the count…
Browse files Browse the repository at this point in the history
…er instead of returning the new value since this is how the macro is used today.
  • Loading branch information
nfi committed Feb 12, 2013
1 parent 19c8f9f commit 26fc2fa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/net/rpl/rpl-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,14 @@
#define RPL_LOLLIPOP_CIRCULAR_REGION 127
#define RPL_LOLLIPOP_SEQUENCE_WINDOWS 16
#define RPL_LOLLIPOP_INIT (RPL_LOLLIPOP_MAX_VALUE - RPL_LOLLIPOP_SEQUENCE_WINDOWS + 1)
#define RPL_LOLLIPOP_INCREMENT(counter) \
((counter) > RPL_LOLLIPOP_CIRCULAR_REGION ? \
++(counter) & RPL_LOLLIPOP_MAX_VALUE : \
++(counter) & RPL_LOLLIPOP_CIRCULAR_REGION)
#define RPL_LOLLIPOP_INCREMENT(counter) \
do { \
if((counter) > RPL_LOLLIPOP_CIRCULAR_REGION) { \
(counter) = ((counter) + 1) & RPL_LOLLIPOP_MAX_VALUE; \
} else { \
(counter) = ((counter) + 1) & RPL_LOLLIPOP_CIRCULAR_REGION; \
} \
} while(0)

#define RPL_LOLLIPOP_IS_INIT(counter) \
((counter) > RPL_LOLLIPOP_CIRCULAR_REGION)
Expand Down

0 comments on commit 26fc2fa

Please sign in to comment.