RDKCOM-5616: RDKBDEV-3470, RDKBACCL-1853: SSH and WebUI not working - Ethernet Configurable WAN I… - #363
RDKCOM-5616: RDKBDEV-3470, RDKBACCL-1853: SSH and WebUI not working - Ethernet Configurable WAN I…#363anatar818 wants to merge 6 commits into
Conversation
…nterface Integration Reason for change: Verify configurable wan interface in BPI R4 (ethagent functionality) Test Procedure: Build and flash the image ,Validate wan functionality for the customized interface name Risks: None
There was a problem hiding this comment.
Pull request overview
This PR aims to restore SSH/WebUI accessibility when the WAN interface name is configurable (e.g., on BPI R4), by ensuring firewall logic uses the correct WAN interface name when generating iptables rules.
Changes:
- When
FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACEis enabled, initializecurrent_wan_ifnamefromsyscfg(wan_physical_ifname) if sysevent doesn’t provide it. - When ETH WAN is enabled, generate the SSH filter iptables rule using
current_wan_ifname(when set) under the configurable-WAN feature flag.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Builds generated at https://gerrit.teamccp.com/#/c/962410/ |
|
Based on @manigandanj input wanInterface buf size changed from BUFLEN_64 to 20 bytes in source/firewall/firewall.c to fix the build issue. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
source/firewall/firewall.c:2390
- In the configurable-WAN branch, if both
current_wan_ifnameanddefault_wan_ifnameare empty andwan_physical_ifnameis not set, the code leavescurrent_wan_ifname/ecm_wan_ifnameempty. That can generate invalid iptables rules elsewhere (e.g., "-i -p tcp ..."). The non-configurable path avoids this by falling back to "erouter0"; the configurable path should keep an equivalent fallback and can simplify by always derivingecm_wan_ifnamefrom the finalcurrent_wan_ifname.
if ('\0' == current_wan_ifname[0]) {
char wanInterface[20] = {'\0'};
syscfg_get(NULL, "wan_physical_ifname", wanInterface, sizeof(wanInterface));
if(wanInterface[0] != '\0'){
snprintf(current_wan_ifname, sizeof(current_wan_ifname), "%s", wanInterface);
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
source/firewall/firewall.c:2399
- In the configurable-WAN path, when
wan_physical_ifnameis empty you copydefault_wan_ifnameintoecm_wan_ifnameusingsizeof(current_wan_ifname).ecm_wan_ifnameis a smaller buffer (20 bytes), so this passes an incorrect destmax tostrcpy_sand can lead to overflow/constraint violations. Also, the legacy fallback to "erouter0" whendefault_wan_ifnameis empty is skipped under this feature flag, leaving WAN ifnames empty.
else{
safec_rc=strcpy_s(current_wan_ifname, sizeof(current_wan_ifname),default_wan_ifname);
ERR_CHK(safec_rc);
safec_rc=strcpy_s(ecm_wan_ifname, sizeof(ecm_wan_ifname),default_wan_ifname);
ERR_CHK(safec_rc);
| else { | ||
| safec_rc=strcpy_s(ecm_wan_ifname, sizeof(current_wan_ifname),current_wan_ifname); | ||
| ERR_CHK(safec_rc); | ||
| } |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
source/firewall/firewall.c:2400
- Under FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE, when sysevent "current_wan_ifname" is empty and syscfg "wan_physical_ifname" is also empty, this falls back to copying default_wan_ifname even when it is empty. This removes the previous (non-feature) fallback to "erouter0" and can leave current_wan_ifname/ecm_wan_ifname empty, which later generates invalid iptables rules (e.g., "-i " with no interface).
safec_rc=strcpy_s(current_wan_ifname, sizeof(current_wan_ifname),default_wan_ifname);
ERR_CHK(safec_rc);
safec_rc=strcpy_s(ecm_wan_ifname, sizeof(ecm_wan_ifname),default_wan_ifname);
ERR_CHK(safec_rc);
}
RDKBACCL-1853 SSH and WebUI not working - Ethernet Configurable WAN Interface Integration
Reason for change: Verify configurable wan interface in BPI R4 (ethagent functionality)
Test Procedure: Build and flash the image ,Validate wan functionality for the customized interface name
Risks: None
Priority : P2