RDKB-64265 Hardcoded WAN Interface Name (erouter0) in Business Gateway Feature#282
RDKB-64265 Hardcoded WAN Interface Name (erouter0) in Business Gateway Feature#282
Conversation
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>
There was a problem hiding this comment.
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_NAMEusage in the IPv6 firewall. - Builds
tr_<current_wan_ifname>_dhcpv6_client_v6prefat runtime (with a fallback whencurrent_wan_ifnameis 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.
There was a problem hiding this comment.
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.
| 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); |
There was a problem hiding this comment.
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.
ac70375 to
6fca25f
Compare
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@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?
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?