mirror of
https://github.com/espressif/openthread.git
synced 2026-09-05 16:50:05 +00:00
[fuzz] allow border router services to start (#11561)
This commit is contained in:
@@ -96,6 +96,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
|
|
||||||
node.GetInstance().SetLogLevel(kLogLevelInfo);
|
node.GetInstance().SetLogLevel(kLogLevelInfo);
|
||||||
|
|
||||||
|
node.GetInstance().Get<BorderRouter::RoutingManager>().Init(/* aInfraIfIndex */ 1, /* aInfraIfIsRunning */ true);
|
||||||
|
node.GetInstance().Get<BorderRouter::RoutingManager>().SetEnabled(true);
|
||||||
node.GetInstance().Get<Srp::Server>().SetAutoEnableMode(true);
|
node.GetInstance().Get<Srp::Server>().SetAutoEnableMode(true);
|
||||||
node.GetInstance().Get<BorderRouter::RoutingManager>().SetDhcp6PdEnabled(true);
|
node.GetInstance().Get<BorderRouter::RoutingManager>().SetDhcp6PdEnabled(true);
|
||||||
node.GetInstance().Get<BorderRouter::RoutingManager>().SetNat64PrefixManagerEnabled(true);
|
node.GetInstance().Get<BorderRouter::RoutingManager>().SetNat64PrefixManagerEnabled(true);
|
||||||
@@ -105,8 +107,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
Log("Form network");
|
Log("Form network");
|
||||||
|
|
||||||
node.Form();
|
node.Form();
|
||||||
nexus.AdvanceTime(13 * 1000);
|
nexus.AdvanceTime(60 * 1000);
|
||||||
VerifyOrQuit(node.Get<Mle::Mle>().IsLeader());
|
VerifyOrQuit(node.Get<Mle::Mle>().IsLeader());
|
||||||
|
VerifyOrQuit(node.Get<Srp::Server>().GetState() == Srp::Server::kStateRunning);
|
||||||
|
|
||||||
Log("---------------------------------------------------------------------------------------");
|
Log("---------------------------------------------------------------------------------------");
|
||||||
Log("Fuzz");
|
Log("Fuzz");
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ set(COMMON_COMPILE_OPTIONS
|
|||||||
add_library(ot-nexus-platform
|
add_library(ot-nexus-platform
|
||||||
platform/nexus_alarm.cpp
|
platform/nexus_alarm.cpp
|
||||||
platform/nexus_core.cpp
|
platform/nexus_core.cpp
|
||||||
|
platform/nexus_infra_if.cpp
|
||||||
platform/nexus_mdns.cpp
|
platform/nexus_mdns.cpp
|
||||||
platform/nexus_misc.cpp
|
platform/nexus_misc.cpp
|
||||||
platform/nexus_node.cpp
|
platform/nexus_node.cpp
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 1
|
#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 1
|
||||||
#define OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE 1
|
#define OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE 1
|
||||||
#define OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE 1
|
#define OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE 1
|
||||||
#define OPENTHREAD_CONFIG_BORDER_ROUTING_MOCK_PLAT_APIS_ENABLE 1
|
|
||||||
#define OPENTHREAD_CONFIG_BORDER_ROUTING_USE_HEAP_ENABLE 1
|
#define OPENTHREAD_CONFIG_BORDER_ROUTING_USE_HEAP_ENABLE 1
|
||||||
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 1
|
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 1
|
||||||
#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 1
|
#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 1
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2025, The OpenThread Authors.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of the copyright holder nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <openthread/platform/infra_if.h>
|
||||||
|
|
||||||
|
namespace ot {
|
||||||
|
namespace Nexus {
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
bool otPlatInfraIfHasAddress(uint32_t, const otIp6Address *) { return false; }
|
||||||
|
|
||||||
|
otError otPlatInfraIfSendIcmp6Nd(uint32_t, const otIp6Address *, const uint8_t *, uint16_t) { return OT_ERROR_NONE; }
|
||||||
|
|
||||||
|
otError otPlatInfraIfDiscoverNat64Prefix(uint32_t) { return OT_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
} // extern "C"
|
||||||
|
|
||||||
|
} // namespace Nexus
|
||||||
|
} // namespace ot
|
||||||
Reference in New Issue
Block a user