The following commit has been merged in the master branch: commit 852b9dcc54d6dc7886c4babe47d8d3f854cd9920 Author: Marek Lindner lindner_marek@yahoo.de Date: Tue Feb 7 17:20:46 2012 +0800
batman-adv: randomize initial seqno to avoid collision
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 3eff7f0..4ac2d1d 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -33,6 +33,11 @@ static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) { struct batman_ogm_packet *batman_ogm_packet; + unsigned long random_seqno; + + /* randomize initial seqno to avoid collision */ + get_random_bytes(&random_seqno, sizeof(unsigned long)); + atomic_set(&hard_iface->seqno, (uint32_t)random_seqno);
hard_iface->packet_len = BATMAN_OGM_LEN; hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC);