Skip to content

RDKB-64443:WAN is going down after restarting the Wanmanager process#201

Open
aadhithan01 wants to merge 24 commits intordkcentral:mainfrom
aadhithan01:Sharman-4012
Open

RDKB-64443:WAN is going down after restarting the Wanmanager process#201
aadhithan01 wants to merge 24 commits intordkcentral:mainfrom
aadhithan01:Sharman-4012

Conversation

@aadhithan01
Copy link
Copy Markdown
Contributor

RDKB-64443:WAN is going down after restarting the Wanmanager process

Reason for change: After Wan-restart internet is not working
Test Procedure: Restart the Wanmanager and check erouter0 is getting ipv6 address
Risks: Low
Signed-off-by:[email protected]

@aadhithan01 aadhithan01 requested a review from a team as a code owner April 13, 2026 16:37
Copilot AI review requested due to automatic review settings April 13, 2026 16:37
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

Updates WanManager’s DHCP client RBUS event handling to avoid WAN going down after a WanManager process restart by improving event parsing robustness and adjusting the RBUS subscription API usage.

Changes:

  • Add NULL checks for DHCP event fields (e.g., IfName, MsgType) before dereferencing.
  • Switch DHCP event subscription from rbusEvent_Subscribe to rbusEvent_SubscribeEx.
Comments suppressed due to low confidence (1)

source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c:46

  • eventData is allocated with malloc and then immediately passed to memset without checking for allocation failure. If malloc returns NULL this will crash; add a NULL check and return early (logging an error) before dereferencing it.
        DhcpEventThreadArgs *eventData = malloc(sizeof(DhcpEventThreadArgs));
        memset(eventData, 0, sizeof(DhcpEventThreadArgs));

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

Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
…enabling DHCP clients to DHCPManager

Set DHCPv4/DHCPv6 Interface parameter to DHCPManager before subscribing
to the .Events, then enable the DHCP client. This ensures the interface
is configured on DHCPManager prior to event subscription so no events
are missed on startup.
Copilot AI review requested due to automatic review settings April 15, 2026 12:19
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 2 out of 2 changed files in this pull request and generated 2 comments.


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

Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c Outdated
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
guto86
guto86 previously approved these changes Apr 15, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 14:23
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 3 out of 3 changed files in this pull request and generated 2 comments.


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

Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Copilot AI review requested due to automatic review settings April 28, 2026 05:47
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 3 out of 3 changed files in this pull request and generated 5 comments.


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

Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c Outdated
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Comment thread source/WanManager/wanmgr_net_utils.c Outdated
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c Outdated
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 3 out of 3 changed files in this pull request and generated 2 comments.


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

Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c Outdated
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c Outdated
Copilot AI review requested due to automatic review settings April 29, 2026 16: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 3 out of 3 changed files in this pull request and generated no new comments.


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

Copilot AI review requested due to automatic review settings April 30, 2026 13:03
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 4 out of 4 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 thread source/WanManager/wanmgr_net_utils.c
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Copilot AI review requested due to automatic review settings April 30, 2026 16:00
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 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c:236

  • In the DHCP_LEASE_UPDATE path, if LeaseInfo isn't a valid bytes payload (e.g., rbusValue_GetBytes returns NULL or bytes_len doesn't match the expected struct size), the code still enqueues the event with a zeroed lease union. WanMgr_ProcessDhcpClientEvent will then treat it as a real lease update and can mark the interface UP with empty IP/gateway data. Drop the event (free eventData and return) when ptr is NULL or the length is unexpected, instead of enqueuing it.
            uint8_t const* ptr = rbusValue_GetBytes(value, &bytes_len);
            if(eventData->version == DHCPV4)
            {
                if((size_t)bytes_len == sizeof(DHCP_MGR_IPV4_MSG))
                {
                    memcpy(&(eventData->lease.v4), ptr, bytes_len);
                }
                else 
                {
                    CcspTraceError(("%s-%d : DHCPv4 lease length %d and expected %d\n", __FUNCTION__, __LINE__, bytes_len,sizeof(DHCP_MGR_IPV4_MSG) ));   
                }
            }
            else
            {
                if((size_t)bytes_len == sizeof(DHCP_MGR_IPV6_MSG))
                {
                    memcpy(&(eventData->lease.v6), ptr, bytes_len);
                }
                else
                {
                    CcspTraceError(("%s-%d : DHCPv6 lease length %d and expected %d\n", __FUNCTION__, __LINE__, bytes_len,sizeof(DHCP_MGR_IPV6_MSG) ));   
                }

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

Comment thread source/WanManager/wanmgr_net_utils.c
Comment thread source/WanManager/wanmgr_net_utils.c
Comment thread source/WanManager/wanmgr_net_utils.c
Copilot AI review requested due to automatic review settings May 4, 2026 07:41
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 4 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
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.

5 participants