mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 18:07:47 +00:00
[fuzz] enable Thread protocols and set state to Leader (#2067)
This commit: - Enables Thread-related protocols and sets the device role state to Leader in fuzz tests. - Bypasses AES-CCM decryption and authentication in fuzz tests.
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/message.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/thread_ftd.h>
|
||||
#include <openthread/types.h>
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
@@ -41,12 +42,16 @@ static otInstance *sInstance;
|
||||
|
||||
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
const otPanId panId = 0xdead;
|
||||
|
||||
sInstance = otInstanceInitSingle();
|
||||
otLinkSetPanId(sInstance, (otPanId)0xdead);
|
||||
otLinkSetPanId(sInstance, panId);
|
||||
otIp6SetEnabled(sInstance, true);
|
||||
otThreadSetEnabled(sInstance, true);
|
||||
otThreadBecomeLeader(sInstance);
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user