diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-07 04:20:46 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 03:53:58 -0400 |
commit | d7d32ec0f199cc00a43434cdd920338763fab2e0 (patch) | |
tree | 1973ed9dc19abe00031de274409e1da9016f68fc /net/batman-adv | |
parent | c2aca02235c014de57b03aa725d9b094f7a87cac (diff) |
batman-adv: randomize initial seqno to avoid collision
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 117b8314e8c7..95bfc5962e1a 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -33,6 +33,11 @@ | |||
33 | static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) | 33 | static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) |
34 | { | 34 | { |
35 | struct batman_ogm_packet *batman_ogm_packet; | 35 | struct batman_ogm_packet *batman_ogm_packet; |
36 | uint32_t random_seqno; | ||
37 | |||
38 | /* randomize initial seqno to avoid collision */ | ||
39 | get_random_bytes(&random_seqno, sizeof(random_seqno)); | ||
40 | atomic_set(&hard_iface->seqno, random_seqno); | ||
36 | 41 | ||
37 | hard_iface->packet_len = BATMAN_OGM_LEN; | 42 | hard_iface->packet_len = BATMAN_OGM_LEN; |
38 | hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC); | 43 | hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC); |