Reported-by: David Miller davem@davemloft.net Signed-off-by: Antonio Quartulli ordex@autistici.org ---
This patch is for *next*. It solves a problem pointed out by David S. Miller. This patch will be squashed with the one which introduced the issue and will be sent out in the next pull request.
Cheers,
bat_iv_ogm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 994369d..ab2085c 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -58,12 +58,12 @@ out: static int bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) { struct batman_ogm_packet *batman_ogm_packet; - unsigned long random_seqno; + uint32_t random_seqno; int res = -1;
/* randomize initial seqno to avoid collision */ - get_random_bytes(&random_seqno, sizeof(unsigned long)); - atomic_set(&hard_iface->seqno, (uint32_t)random_seqno); + get_random_bytes(&random_seqno, sizeof(random_seqno)); + atomic_set(&hard_iface->seqno, random_seqno);
hard_iface->packet_len = BATMAN_OGM_HLEN; hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC);