Skip to content

RDKB-64265 Hardcoded WAN Interface Name (erouter0) in Business Gateway Feature#282

Open
rirfha948 wants to merge 4 commits intodevelopfrom
topic/RDKB-64265
Open

RDKB-64265 Hardcoded WAN Interface Name (erouter0) in Business Gateway Feature#282
rirfha948 wants to merge 4 commits intodevelopfrom
topic/RDKB-64265

Conversation

@rirfha948
Copy link
Copy Markdown
Contributor

Reason for change: Removing erouter0 hardcode for reusability for different wan interface
Test Procedure:

  • Build OneStack Image

  • In Business-mode, Check dibbler server is started and server.conf has prefix-delegation class

  • In Residential-mode, check whether device behaves as a non-CBR device Risks: None
    Priority: P1

  • [] Is this a User Story (US)?
    This is a bug ticket

  • Have all dependent PRs from other components been listed ?

  • Does the commit message include both the User Story ticket and the Subtask ticket?

  • Will be all changes related to the User Story squashed and merged in a single commit?

  • Has the PR been raised only after completing all changes for the User Story (no partial changes)?

  • Has code development for the User Story been completed?

  • If yes, has the Gerrit topic or list of all dependent PRs across components (including meta-layer changes) been shared?
    https://gerrit.teamccp.com/#/c/946157/

  • Is there a validation log available in the Jira ticket for verifying builds with the updated generic-srcrev.inc across all platforms?

            vs residential Partner ID as part of single build

Reason for change: Prefix delegation handling
Test Procedure:
  - Build OneStack Image
  - In Business-mode, Check dibbler server is started and server.conf
    has prefix-delegation class
  - In Residential-mode,  check whether device behaves as a non-CBR device
Risks: None
Priority: P1
Signed-off-by: rirfha948 <rasina_irfhan@comcast.com>
@rirfha948 rirfha948 requested review from a team as code owners April 1, 2026 11:32
Copilot AI review requested due to automatic review settings April 1, 2026 11:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to remove the hardcoded erouter0-based DHCPv6 prefix sysevent key usage in the IPv6 firewall path by dynamically building the prefix sysevent name from the current WAN interface name, improving reusability across platforms where the WAN interface name differs.

Changes:

  • Removes the fixed COSA_DML_DHCPV6C_PREF_SYSEVENT_NAME usage in the IPv6 firewall.
  • Builds tr_<current_wan_ifname>_dhcpv6_client_v6pref at runtime (with a fallback when current_wan_ifname is unset) and uses it to fetch the delegated prefix in multiple code paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1299 to 1303
fprintf(fp, "-A FORWARD -i brlan0 -o erouter0 -s %s -j REJECT --reject-with icmp6-policy-fail\n", prev_prefix);
}
#endif
if ( '\0' != prefix[0] ) {
if (( '\0' != prefix[0] ) && (strlen(current_wan_interface) != 0)) {
//fprintf(fp, "-A FORWARD ! -s %s -i %s -m limit --limit 10/sec -j LOG --log-level %d --log-prefix \"UTOPIA: FW. IPv6 FORWARD anti-spoofing\"\n", prefix, lan_ifname,syslog_level);
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current_wan_interface is declared only under _ONESTACK_PRODUCT_REQ_, but it’s referenced unconditionally in the if (( '\0' != prefix[0] ) && (strlen(current_wan_interface) != 0)) check. This will fail to compile for non-Onestack builds, and even on Onestack it can incorrectly skip adding IPv6 anti-spoofing rules when FEATURE_IPV6_DELEGATION is not supported (since current_wan_interface is never populated in the non-delegation branch). Consider either (a) guarding the current_wan_interface check with _ONESTACK_PRODUCT_REQ_ and only requiring it when delegation is enabled, or (b) always initializing current_wan_interface (e.g., from current_wan_ifname) before this check.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 2, 2026 08:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if(isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
{
sysevent_get(sysevent_fd, sysevent_token, COSA_DML_DHCPV6C_PREF_SYSEVENT_NAME, prefix, sizeof(prefix));
sysevent_get(sysevent_fd, sysevent_token, "current_wan_ifname", current_wan_interface, sizeof(current_wan_interface));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello ,
Why can’t we use the existing ipv6_prefix sysevent?
Currently, the ipv6_prefix sysevent is used by the WAN component to inform the system of the LAN prefix.
These changes would alter the existing contract between components.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipv6_prefix doesn't show the right prefix length, even though server sends /56, ipv6_prefix hard codes it to /64 which is wrong.

If this issue is fixed, we can use ipv6_prefix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @snayak002c
ipv6_prefix should be working. It sets /64 for the residential gateways for the LAN. In case of business, it will set the received prefix length as it is.
https://github.com/rdkcentral/wan-manager/blob/main/source/WanManager/wanmgr_dhcpv6_apis.c#L2097

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@S-Parthiban-Selvaraj , This change is on XB10 one stack which supports both residential / business mode based on the partnerID/device mode. We can't enable CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION MACRO on this platform.

BTW why are we setting ipv6 prefix length differently on residential/ business. Shouldn't it return what it received from the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants