RDKCOM-5595: RDKBDEV-3450 The CM is not updated with DNS Name (Option15), instead utopia.net is displayed in LAN side provisioning.#214
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds DHCPv4 domain-name propagation to WanManager via sysevent and uses it as an additional trigger for DHCP server restart when DNS/domain changes.
Changes:
- Introduces a new sysevent key (
dhcp_domain) for storing the current IPv4 domain name. - Captures and updates the domain name in
wan_updateDNS()and includes it in the “restart needed” comparison. - Extends DHCPv4 event parsing/data model to carry the domain name through IPC into
WANMGR_IPV4_DATA.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| source/WanManager/wanmgr_sysevents.h | Adds a sysevent constant for DHCP domain name storage. |
| source/WanManager/wanmgr_interface_sm.c | Reads/writes the domain sysevent and factors domain changes into restart decision. |
| source/WanManager/wanmgr_dhcpv4_apis.c | Copies domain from IPC data into IPv4 data and treats domain changes as update-worthy. |
| source/TR-181/include/wanmgr_dml.h | Extends WANMGR_IPV4_DATA with a domain field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CcspTraceInfo(("%s %d: Domain is received, setting sysevent dhcp_domain = %s\n", __FUNCTION__, __LINE__, p_VirtIf->IP.Ipv4Data.domain)); | ||
| sysevent_set(sysevent_fd, sysevent_token, SYSEVENT_IPV4_DOMAIN, p_VirtIf->IP.Ipv4Data.domain, 0); |
…d utopia.net is displayed in LAN side provisioning. Reason for change: Added provisioning to fetch the DHCPv4 Option 15 (Domain Name) value via udhcpc and forward it to the WAN Manager. The WAN Manager then sets the corresponding sysevent, enabling dnsmasq to propagate the domain name to LAN clients. Risks: Low Signed-off-by: Aiswarya Prasad <aprasad@maxlinear.com>
| memcpy(pDhcpv4Data->gateway, pIpcIpv4Data->gateway, BUFLEN_32); | ||
| memcpy(pDhcpv4Data->dnsServer, pIpcIpv4Data->dnsServer, BUFLEN_64); | ||
| memcpy(pDhcpv4Data->dnsServer1, pIpcIpv4Data->dnsServer1, BUFLEN_64); | ||
| snprintf(pDhcpv4Data->domain, sizeof(pDhcpv4Data->domain), "%s", pIpcIpv4Data->domain); |
| // clear domain name sysevent | ||
| sysevent_set(sysevent_fd, sysevent_token, SYSEVENT_IPV4_DOMAIN, "", 0); | ||
|
|
| CcspTraceInfo(("%s %d: Setting dhcp_domain sysevent = \"%s\"\n", __FUNCTION__, __LINE__, desiredDomain)); | ||
| sysevent_set(sysevent_fd, sysevent_token, SYSEVENT_IPV4_DOMAIN, desiredDomain, 0); |
| memcpy(pDhcpv4Data->gateway, pIpcIpv4Data->gateway, BUFLEN_32); | ||
| memcpy(pDhcpv4Data->dnsServer, pIpcIpv4Data->dnsServer, BUFLEN_64); | ||
| memcpy(pDhcpv4Data->dnsServer1, pIpcIpv4Data->dnsServer1, BUFLEN_64); | ||
| snprintf(pDhcpv4Data->domain, sizeof(pDhcpv4Data->domain), "%s", pIpcIpv4Data->domain); |
There was a problem hiding this comment.
Hi @aprasad-97,
Could you use memcpy? Or do you see any issue with it?
There was a problem hiding this comment.
Actually, this is used to handle Buffer safety and NULL termination which is not handled by memcpy.
|
Do we have any struct change in any other component related to this? like common lib |
Yes. These are the other PRs related to this ticket: |
Reason for change: Added provisioning to fetch the DHCPv4 Option 15 (Domain Name) value via udhcpc and forward it to the WAN Manager. The WAN Manager then sets the corresponding sysevent, enabling dnsmasq to propagate the domain name to LAN clients.
Risks: Low