mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-30 13:38:40 +00:00
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>
This commit is contained in:
parent
c2aca02235
commit
d7d32ec0f1
@ -33,6 +33,11 @@
|
||||
static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface)
|
||||
{
|
||||
struct batman_ogm_packet *batman_ogm_packet;
|
||||
uint32_t random_seqno;
|
||||
|
||||
/* randomize initial seqno to avoid collision */
|
||||
get_random_bytes(&random_seqno, sizeof(random_seqno));
|
||||
atomic_set(&hard_iface->seqno, random_seqno);
|
||||
|
||||
hard_iface->packet_len = BATMAN_OGM_LEN;
|
||||
hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC);
|
||||
|
Loading…
Reference in New Issue
Block a user