1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

netdev: Initialize sequence number to random value

This commit is contained in:
Koen Zandberg 2018-07-10 18:31:09 +02:00
parent ecaef7bfc5
commit aecbad960a
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
2 changed files with 4 additions and 1 deletions

View File

@ -59,6 +59,7 @@ endif
ifneq (,$(filter netdev_ieee802154,$(USEMODULE)))
USEMODULE += ieee802154
USEMODULE += random
endif
ifneq (,$(filter gnrc_uhcpc,$(USEMODULE)))

View File

@ -22,6 +22,7 @@
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/netdev.h"
#include "random.h"
#include "net/netdev/ieee802154.h"
@ -52,7 +53,8 @@ static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len)
void netdev_ieee802154_reset(netdev_ieee802154_t *dev)
{
dev->seq = 0;
/* Only the least significant byte of the random value is used */
dev->seq = random_uint32();
dev->flags = 0;
/* set default protocol */