RDKB-63902 : Unable to access MSO login page#108
Conversation
Reason for change: Added interface handling for WANOE, EPON, and XGSPON - XF10 Test Procedure: Verify MSO Login is successfull Priority: P1 Risks: Low Signed-off-by: Leela Charumathi M <LeelaCharumathi_M@comcast.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses RDKB-63902 (“Unable to access MSO login page”) by extending WAN interface detection logic so the UI correctly classifies requests when WAN is active over WANOE, EPON, or XGSPON (XF10).
Changes:
- Read WAN Manager
InterfaceActiveStatusto detect WANOE/EPON/XGSPON active states. - When detected, use
CurrentActiveInterfaceto compute interface IPs and apply the existing remote-access / bridge-static gating logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| $currentIface = getStr("Device.X_RDK_WanManager.CurrentActiveInterface"); | ||
| $remote_ip=get_ips($currentIface); |
There was a problem hiding this comment.
$currentIface comes from a TR-181 string and is passed directly into get_ips(), which builds a shell command via string concatenation (see get_ips() using ip addr show + $if_name). This introduces a command-injection/argument-injection risk (e.g., whitespace or shell metacharacters in CurrentActiveInterface) and can also cause ip addr show to run without an interface when the value is empty. Please validate/whitelist the interface name (and fail closed if empty/invalid) before calling get_ips() (or escape the argument safely).
| $currentIface = getStr("Device.X_RDK_WanManager.CurrentActiveInterface"); | |
| $remote_ip=get_ips($currentIface); | |
| $currentIface = trim(getStr("Device.X_RDK_WanManager.CurrentActiveInterface")); | |
| // Validate interface name before using it in get_ips(), which builds a shell command. | |
| if ($currentIface === "" || !preg_match('/^[a-zA-Z0-9_.:-]+$/', $currentIface)) { | |
| // Fail closed: treat as no remote IPs if interface name is empty/invalid. | |
| $remote_ip = array(); | |
| } else { | |
| $remote_ip = get_ips($currentIface); | |
| } |
| }else if(strstr($wanStatus,"WANOE,1") || strstr($wanStatus,"EPON,1") || strstr($wanStatus,"XGSPON,1")){ | ||
| $currentIface = getStr("Device.X_RDK_WanManager.CurrentActiveInterface"); | ||
| $remote_ip=get_ips($currentIface); | ||
| if (in_array($server_ip,$remote_ip)){ | ||
| $adminOnlyMode= "false"; | ||
| if( $remoteAcess && ($httpRemoteEnable || $httpsRemoteEnable) && (($server_port==$httpRemotePort)|| ($server_port==$httpsRemotePort))){ | ||
| return "rm_ip"; | ||
| } | ||
| } | ||
| if(($lanMode=="bridge-static")&&($adminOnlyMode=="true")){ | ||
| return "rm_ip"; | ||
| } | ||
| return "eth_ip"; |
There was a problem hiding this comment.
The new WANOE/EPON/XGSPON branch duplicates the same remote-access/bridge-static logic used in the ethernet branch, but with different indentation (spaces vs tabs) and trailing whitespace. This makes the control flow harder to read and increases the chance of the branches drifting over time. Consider factoring the common logic into a shared path (e.g., compute the upstream interface once, then run the same checks) and align indentation with the surrounding code style.
RDKB-63902 : Unable to access MSO login page
Reason for change: Added interface handling for WANOE, EPON, and XGSPON - XF10
Test Procedure: Verify MSO Login is successfull
Priority: P1
Risks: Low
Signed-off-by: Leela Charumathi M LeelaCharumathi_M@comcast.com