RDKB-58910 : Move the WAN IPV6 configuration from LAN bridge#79
Merged
Conversation
Reason for change: Solving Build errors
Test Procedure:
Updated in Jira.
Risks: none
Priority: P1
Signed-off-by: parthiban.selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: parthiban.selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: parthiban.selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
…eint after WFO Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Fixing Virtual interface name set. Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
…ive VISM for products use the same default name for all interfaces Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: S-Parthiban-Selvaraj <parthiban.selvaraj@sky.uk>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…4. WAN address now comes from the same /64 as LAN. 2. Changed prefix_length >= 64 to prefix_length > 64 — Now accepts /64 delegations (previously rejected them). Only rejects prefixes longer than /64 where no /64 subnet can be derived. 3. Updated all comments and doxygen with RFC references: RFC 7084 Section 4.2 WAA-7 — CE router MUST create address from delegated prefix RFC 9096 Section 3.3 & 3.5 — Addresses should track prefix lifetimes; using same /64 aligns with renumbering expectations RFC 4862 Section 5.4 — DAD is mandatory, provides collision safeguard Inline comments explain why EUI-64 is collision-free (different MACs) and why ::1 suffix is safe
- Enable NDP proxy on the LAN bridge to respond to Neighbor Solicitations for the WAN address. - Add NDP proxy entry for the WAN address to facilitate upstream routing and prevent DAD success for LAN clients. - Update function to remove NDP proxy entry when removing IPv6 routes and addresses. Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LakshminarayananShenbagaraj
previously approved these changes
May 18, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
guto86
previously approved these changes
May 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (2)
source/WanManager/wanmgr_dhcpv6_apis.c:1676
- wanmgr_construct_wan_address_from_IAPD() ignores the return value of WanMgr_create_eui64_ipv6_address() and then unconditionally sets addrAssigned=true/addrCmd=ADD. If address construction fails (or produces an empty/invalid address), the subsequent
ip -6 addr addwill be executed with bad input and the lease will be treated as valid. Please check the return value, validate the generated address string, and propagate failures (return -1 / don’t set addrAssigned) when construction or command execution fails.
if(IPv6EUI64FormatSupport)
{
/* EUI-64: IID derived from WAN interface MAC — deterministically unique per interface.
* No collision possible with LAN clients (different MACs produce different IIDs). */
char prefStr[128] = {0};
inet_ntop(AF_INET6, &prefix, prefStr, sizeof(prefStr));
CcspTraceInfo(("%s %d EUI64 format is enabled, using prefix %s for WAN address\n", __FUNCTION__, __LINE__, prefStr));
snprintf(cmdLine, sizeof(cmdLine), "%s/%d", prefStr, prefix_length);
WanMgr_create_eui64_ipv6_address(cmdLine, pIpv6DataNew->ifname, pIpv6DataNew->address);
}
else
{
/* Non-EUI-64: Use well-known suffix ::1 (mirrors IPv4 gateway convention).
* SLAAC EUI-64 clients never generate ::1; DHCPv6 server should exclude ::1 from pool. */
CcspTraceInfo(("%s %d EUI64 format is not enabled, using WAN_SUFFIX %d\n", __FUNCTION__, __LINE__, WAN_SUFFIX));
prefix.s6_addr[15] = WAN_SUFFIX;
inet_ntop(AF_INET6, &prefix, pIpv6DataNew->address, sizeof(pIpv6DataNew->address));
}
pIpv6DataNew->addrAssigned = true;
pIpv6DataNew->addrCmd = IFADDRCONF_ADD;
CcspTraceInfo(("%s %d Calculated WAN address %s/128\n", __FUNCTION__, __LINE__, pIpv6DataNew->address));
source/WanManager/wanmgr_dhcpv6_apis.c:1699
- Even when
ip -6 addr add ...orip -6 neigh add proxy ...fails, the function still returns 0 and leaves addrAssigned set. Consider treating these command failures as fatal (return -1 and avoid updating sysevents/flags) so upper layers can retry or fall back cleanly.
CcspTraceInfo(("%s %d Calculated WAN address %s/128\n", __FUNCTION__, __LINE__, pIpv6DataNew->address));
// Assign the /128 host address on the WAN interface
memset(cmdLine, 0, sizeof(cmdLine));
snprintf(cmdLine, sizeof(cmdLine), "ip -6 addr add %s/128 dev %s", pIpv6DataNew->address, pIpv6DataNew->ifname);
if (WanManager_DoSystemActionWithStatus(__FUNCTION__, cmdLine) != 0)
CcspTraceError(("failed to run cmd: %s", cmdLine));
/* Enable NDP proxy on the LAN bridge so the kernel responds to Neighbor Solicitations
* for the WAN address on brlan0. This ensures:
* - LAN clients performing DAD for this address will get a Neighbor Advertisement back,
* causing their DAD to fail (preventing them from using the WAN address). */
memset(cmdLine, 0, sizeof(cmdLine));
snprintf(cmdLine, sizeof(cmdLine), "sysctl -w net.ipv6.conf.%s.proxy_ndp=1", COSA_DML_DHCPV6_SERVER_IFNAME);
WanManager_DoSystemActionWithStatus(__FUNCTION__, cmdLine);
/* Add NDP proxy entry for the WAN address on the LAN bridge.
* This makes the kernel respond to Neighbor Solicitations for our WAN address
* on brlan0, which:
* 1. Enables upstream routing to reach the WAN address via the LAN bridge if needed.
* 2. Causes DAD to fail for any LAN client that tries to use this address. */
memset(cmdLine, 0, sizeof(cmdLine));
snprintf(cmdLine, sizeof(cmdLine), "ip -6 neigh add proxy %s dev %s", pIpv6DataNew->address, COSA_DML_DHCPV6_SERVER_IFNAME);
if (WanManager_DoSystemActionWithStatus(__FUNCTION__, cmdLine) != 0)
CcspTraceError(("%s %d failed to add NDP proxy entry on %s for %s\n", __FUNCTION__, __LINE__, COSA_DML_DHCPV6_SERVER_IFNAME, pIpv6DataNew->address));
LakshminarayananShenbagaraj
approved these changes
May 18, 2026
guto86
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves WAN IPv6 configuration from the LAN bridge to the WAN interface itself, addressing an issue where IANA is not assigned by the BNG (Broadband Network Gateway). The changes enable the creation of IPv6 addresses on WAN interfaces from delegated prefixes when IANA addresses are not provided.
Key changes:
Removed IPv6 configuration from LAN bridge and moved it to WAN interfaces
Added new function to construct WAN IPv6 addresses from IAPD (IA Prefix Delegation)
Updated IPv6 utility functions to work with virtual interfaces instead of interface names
Cleaned up LAN-specific IPv6 handling code and legacy bridge mode logic
This PR is dependent on the following related PRs:
rdkcentral/telco-voice-manager#5
rdkcentral/utopia#69
#79
rdkcentral/provisioning-and-management#127
rdkcentral/xconf-client#20
rdkcentral/test-and-diagnostic#172
https://github.com/rdk-gdcs/firewall/pull/5
rdkcentral/sysint-broadband#34