Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit 02c55911ea4484abdf72f70f8a576d1e855a34c3 Author: Akinobu Mita akinobu.mita@gmail.com Date: Mon Dec 24 11:14:07 2012 +0900
batman-adv: rename random32() to prandom_u32()
Use more preferable function name which implies using a pseudo-random number generator.
Signed-off-by: Akinobu Mita akinobu.mita@gmail.com Acked-by: Antonio Quartulli ordex@autistici.org Signed-off-by: Marek Lindner lindner_marek@yahoo.de Cc: Simon Wunderlich siwu@hrz.tu-chemnitz.de Cc: Antonio Quartulli ordex@autistici.org Cc: b.a.t.m.a.n@lists.open-mesh.org Cc: "David S. Miller" davem@davemloft.net Cc: netdev@vger.kernel.org
02c55911ea4484abdf72f70f8a576d1e855a34c3 bat_iv_ogm.c | 4 ++-- compat.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 8f2de43..36b9727 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -123,7 +123,7 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) unsigned int msecs;
msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER; - msecs += random32() % (2 * BATADV_JITTER); + msecs += prandom_u32() % (2 * BATADV_JITTER);
return jiffies + msecs_to_jiffies(msecs); } @@ -131,7 +131,7 @@ batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) /* when do we schedule a ogm packet to be sent */ static unsigned long batadv_iv_ogm_fwd_send_time(void) { - return jiffies + msecs_to_jiffies(random32() % (BATADV_JITTER / 2)); + return jiffies + msecs_to_jiffies(prandom_u32() % (BATADV_JITTER / 2)); }
/* apply hop penalty for a normal link */ diff --git a/compat.h b/compat.h index 07ac401..dcf72ee 100644 --- a/compat.h +++ b/compat.h @@ -194,4 +194,10 @@ static inline void eth_hw_addr_random(struct net_device *dev)
#endif /* < KERNEL_VERSION(3, 8, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) + +#define prandom_u32() random32() + +#endif /* < KERNEL_VERSION(3, 9, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_H_ */