mirror of
https://github.com/espressif/openthread.git
synced 2026-09-15 05:30:09 +00:00
[routing-manager] include Stub Router flag in emitted RAs by BR (#9486)
This commit updates `RoutingManager` to include the Flags Extension Option with Stub Router flag in its emitted Router Advertisement messages. Config `STUB_ROUTER_FLAG_IN_EMITTED_RA_ENABLE` can be used to enable or disable this behavior which is enabled by default.
This commit is contained in:
@@ -449,6 +449,17 @@ void ValidateRouterAdvert(const Icmp6Packet &aPacket)
|
||||
break;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_STUB_ROUTER_FLAG_IN_EMITTED_RA_ENABLE
|
||||
case Ip6::Nd::Option::kTypeRaFlagsExtension:
|
||||
{
|
||||
const Ip6::Nd::RaFlagsExtOption &flagsOption = static_cast<const Ip6::Nd::RaFlagsExtOption &>(option);
|
||||
|
||||
VerifyOrQuit(flagsOption.IsValid());
|
||||
VerifyOrQuit(flagsOption.IsStubRouterFlagSet());
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
default:
|
||||
VerifyOrQuit(false, "Unexpected option type in RA msg");
|
||||
}
|
||||
@@ -545,6 +556,15 @@ void LogRouterAdvert(const Icmp6Packet &aPacket)
|
||||
break;
|
||||
}
|
||||
|
||||
case Ip6::Nd::Option::kTypeRaFlagsExtension:
|
||||
{
|
||||
const Ip6::Nd::RaFlagsExtOption &flagsOption = static_cast<const Ip6::Nd::RaFlagsExtOption &>(option);
|
||||
|
||||
VerifyOrQuit(flagsOption.IsValid());
|
||||
Log(" FlagsExt - StubRouter:%u", flagsOption.IsStubRouterFlagSet());
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
VerifyOrQuit(false, "Bad option type in RA msg");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user