Skip to content

RDKB-63168: WAN Default Gateway Address (IPv4) is blank#111

Merged
GoutamD2905 merged 2 commits intodevelopfrom
bug/RDKB-63168
Mar 26, 2026
Merged

RDKB-63168: WAN Default Gateway Address (IPv4) is blank#111
GoutamD2905 merged 2 commits intodevelopfrom
bug/RDKB-63168

Conversation

@pavankumar464
Copy link
Copy Markdown
Contributor

Reason for change: WAN Default Gateway Address (IPv4) in Network section is blank - GPON mode

Test Procedure: Test for WAN Default Gateway Address (IPv4) in Network section - GPON mode

Risks:low
Priority: P1
Signed-off-by: pavankumarreddy_balireddy@comcast.com

Reason for change: WAN Default Gateway Address (IPv4) in Network section is blank - GPON mode

Test Procedure: Test for WAN Default Gateway Address (IPv4) in Network section - GPON mode

Risks:low
Priority: P1
Signed-off-by: pavankumarreddy_balireddy@comcast.com
Copilot AI review requested due to automatic review settings March 26, 2026 08:55
@pavankumar464 pavankumar464 requested review from a team as code owners March 26, 2026 08:55
Copy link
Copy Markdown

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

Fixes cases where the WAN Default Gateway Address (IPv4) displays as blank in the Network section (notably in GPON mode) by ensuring the UI selects a valid DHCP client interface even when DHCP manager/WanManager interface data isn’t available yet.

Changes:

  • Detects whether DHCP manager initialization has completed via /tmp/dhcpmgr_initialized.
  • When not initialized, falls back to default TR-181 DHCP client objects (Device.DHCPv4.Client.1 / Device.DHCPv6.Client.1).
  • Retains existing logic to select DHCP interfaces from the active WanManager interface when available.

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

Comment on lines +1265 to +1281
$dhcpmgr_enabled = file_exists("/tmp/dhcpmgr_initialized");
var $dhcp_client_interfaces = { v4: "", v6: "" };
$ids = explode(",", getInstanceIds("Device.X_RDK_WanManager.Interface."));
wanInterfaceLoop: for($key in $ids) { $j = $ids[$key];
$status = getStr("Device.X_RDK_WanManager.Interface."+$j+".Status");
if($status == "true" || $status == "Up" || $status == "Active"){
$dhcp_client_interfaces.v4 = getStr("Device.X_RDK_WanManager.Interface."+$j+".VirtualInterface.1.IP.DHCPv4Interface");
$dhcp_client_interfaces.v6 = getStr("Device.X_RDK_WanManager.Interface."+$j+".VirtualInterface.1.IP.DHCPv6Interface");
break wanInterfaceLoop;
if($dhcpmgr_enabled) {
$ids = explode(",", getInstanceIds("Device.X_RDK_WanManager.Interface."));
wanInterfaceLoop: for($key in $ids) { $j = $ids[$key];
$status = getStr("Device.X_RDK_WanManager.Interface."+$j+".Status");
if($status == "true" || $status == "Up" || $status == "Active"){
$dhcp_client_interfaces.v4 = getStr("Device.X_RDK_WanManager.Interface."+$j+".VirtualInterface.1.IP.DHCPv4Interface");
$dhcp_client_interfaces.v6 = getStr("Device.X_RDK_WanManager.Interface."+$j+".VirtualInterface.1.IP.DHCPv6Interface");
break wanInterfaceLoop;
}
}
if($dhcp_client_interfaces.v4 == "") $dhcp_client_interfaces.v4 = "Device.DHCPv4.Client.1";
if($dhcp_client_interfaces.v6 == "") $dhcp_client_interfaces.v6 = "Device.DHCPv6.Client.1";
} else {
$dhcp_client_interfaces.v4 = "Device.DHCPv4.Client.1";
$dhcp_client_interfaces.v6 = "Device.DHCPv6.Client.1";
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The default DHCP client interface assignments are duplicated (set in the else branch and again inside the if ($dhcpmgr_enabled) branch when values remain empty). This can be simplified by setting defaults once before the conditional/loop and only overriding them when an active WAN interface provides specific DHCPv4/v6 interface paths, reducing duplicated logic and future drift.

Copilot uses AI. Check for mistakes.
@GoutamD2905 GoutamD2905 merged commit 3b4582b into develop Mar 26, 2026
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants