[riot-notifications] [RIOT-OS/RIOT] gnrc_ipv6_nib/arsm: ensure proper int width in backoff calculation (#10369)
notifications at github.com
Tue Jan 29 14:53:18 CET 2019
miri64 commented on this pull request.
> + * @pre (NDP_MIN_RANDOM_FACTOR <= factor < NDP_MAX_RANDOM_FACTOR)
+ * @pre (ns_sent <= NDP_MAX_NS_NUMOF)
+ * @return exponential back-off of the retransmission timer
+static inline uint32_t _exp_backoff_retrans_timer_factor(uint8_t ns_sent,
+ uint32_t retrans_timer,
+ uint32_t factor)
+ assert(NDP_MIN_RANDOM_FACTOR <= factor);
+ assert(factor < NDP_MAX_RANDOM_FACTOR);
+ assert(ns_sent <= NDP_MAX_NS_NUMOF);
+ /* backoff according to https://tools.ietf.org/html/rfc7048 with
+ * BACKOFF_MULTIPLE == 2 */
+ uint32_t res = (uint32_t)(((uint64_t)(((uint32_t) 1) << ns_sent) *
+ retrans_timer * factor) / US_PER_MS);
There is already another comment above :-/
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications