internet-apps: (fixes #1195) RADVD announcing prefixes without autoconfiguration

This commit is contained in:
Tommaso Pecorella
2025-03-05 21:12:37 +01:00
committed by Tommaso Pecorella
parent 9991d765d7
commit bb6183ded8
3 changed files with 10 additions and 2 deletions

View File

@@ -18,6 +18,8 @@ This file is a best-effort approach to solving this issue; we will do our best b
### Changes to existing API
* (internet-apps) Added a parameter to the RADVD helper to announce a prefix without the autoconfiguration flag.
### Changes to build system
### Changed behavior

View File

@@ -27,7 +27,8 @@ RadvdHelper::RadvdHelper()
void
RadvdHelper::AddAnnouncedPrefix(uint32_t interface,
const Ipv6Address& prefix,
uint32_t prefixLength)
uint32_t prefixLength,
bool slaac)
{
NS_LOG_FUNCTION(this << int(interface) << prefix << int(prefixLength));
if (prefixLength != 64)
@@ -59,6 +60,7 @@ RadvdHelper::AddAnnouncedPrefix(uint32_t interface,
if (!prefixFound)
{
Ptr<RadvdPrefix> routerPrefix = Create<RadvdPrefix>(prefix, prefixLength);
routerPrefix->SetAutonomousFlag(slaac);
m_radvdInterfaces[interface]->AddPrefix(routerPrefix);
}
}

View File

@@ -35,8 +35,12 @@ class RadvdHelper : public ApplicationHelper
* @param interface outgoing interface
* @param prefix announced IPv6 prefix
* @param prefixLength announced IPv6 prefix length
* @param slaac available for autoconfiguration
*/
void AddAnnouncedPrefix(uint32_t interface, const Ipv6Address& prefix, uint32_t prefixLength);
void AddAnnouncedPrefix(uint32_t interface,
const Ipv6Address& prefix,
uint32_t prefixLength,
bool slaac = true);
/**
* @brief Enable the router as default router for the interface.