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:
parent
ecaef7bfc5
commit
aecbad960a
@ -59,6 +59,7 @@ endif
|
||||
|
||||
ifneq (,$(filter netdev_ieee802154,$(USEMODULE)))
|
||||
USEMODULE += ieee802154
|
||||
USEMODULE += random
|
||||
endif
|
||||
|
||||
ifneq (,$(filter gnrc_uhcpc,$(USEMODULE)))
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user