RDKB-65015 RDKB-65326 : Enable Multi-profile XDNS on XB10(single build) - #26
Conversation
There was a problem hiding this comment.
Pull request overview
Enables Multi-profile XDNS behavior on XB10 single-build by removing device-mode (business vs residential) gating so the same code paths execute under _ONESTACK_PRODUCT_REQ_ for both modes.
Changes:
- Removed
is_devicemode_business()conditionals around DNSSEC syscfg updates and multi-profile handling so behavior applies in both device modes. - Updated webconfig cache application and blob parsing paths to treat RDK-default DNS strings consistently across modes.
- Ensured MultiProfile status lines are handled when syncing/writing resolv.conf-derived content.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| source/dmlxdns/cosa_xdns_webconfig_api.c | Removes business-mode gating for DNSSEC syscfg updates and default DNS parsing during webconfig apply. |
| source/dmlxdns/cosa_xdns_dml.c | Makes DNSSecEnable DML behavior available outside business mode by removing mode checks. |
| source/dmlxdns/cosa_xdns_apis.c | Applies MultiProfile resolv.conf filtering/status handling for all _ONESTACK_PRODUCT_REQ_ / BCI builds, not only business mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0) | ||
| { | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0) | ||
| { | ||
| CcspTraceError(("[XDNS] syscfg_set XDNS_DNSSecEnable failed!\n")); | ||
| } | ||
| else | ||
| { | ||
| fprintf(stderr, "%s [XDNS] XDNS_DNSSecEnable value is set to %s in DB\n", __FUNCTION__, bval); | ||
| } | ||
| CcspTraceError(("[XDNS] syscfg_set XDNS_DNSSecEnable failed!\n")); | ||
| } | ||
| else | ||
| { | ||
| fprintf(stderr, "%s [XDNS] XDNS_DNSSecEnable value is set to %s in DB\n", __FUNCTION__, bval); | ||
| } | ||
| #endif // _CBR_PRODUCT_REQ_ || _ONESTACK_PRODUCT_REQ_ |
| #if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0) | ||
| { | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0) | ||
| { | ||
| fprintf(stderr, "%s syscfg_set XDNS_DNSSecEnable failed %d !!!\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } | ||
| else | ||
| { | ||
| fprintf(stderr, "%s XDNS_DNSSecEnable value is set to %d in DB\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } | ||
| fprintf(stderr, "%s syscfg_set XDNS_DNSSecEnable failed %d !!!\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } | ||
| else | ||
| { | ||
| fprintf(stderr, "%s XDNS_DNSSecEnable value is set to %d in DB\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } | ||
| #endif // _CBR_PRODUCT_REQ_ || _ONESTACK_PRODUCT_REQ_ |
| fprintf(fp2, "XDNS_Multi_Profile Enabled\n"); | ||
| fprintf(stderr, "## CcspXDNS #### Multi Profile XDNS feature is Enabled\n"); | ||
| } | ||
| else | ||
| { | ||
| fprintf(fp2, "XDNS_Multi_Profile Disabled\n"); | ||
| fprintf(stderr, "## CcspXDNS #### Multi Profile XDNS feature is disabled\n"); |
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| { | ||
| char multiprofile_flag[5] = {0}; | ||
| syscfg_get(NULL, "MultiProfileXDNS", multiprofile_flag, sizeof(multiprofile_flag)); |
| #if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0) | ||
| { | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0) | ||
| { | ||
| fprintf(stderr, "%s syscfg_set XDNS_DNSSecEnable failed %d !!!\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } | ||
| else | ||
| { | ||
| fprintf(stderr, "%s XDNS_DNSSecEnable value is set to %d in DB\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } | ||
| fprintf(stderr, "%s syscfg_set XDNS_DNSSecEnable failed %d !!!\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable); | ||
| } |
| #if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0) | ||
| { | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0) | ||
| { | ||
| CcspTraceError(("[XDNS] syscfg_set XDNS_DNSSecEnable failed!\n")); | ||
| } | ||
| else | ||
| { | ||
| fprintf(stderr, "%s [XDNS] XDNS_DNSSecEnable value is set to %s in DB\n", __FUNCTION__, bval); | ||
| } | ||
| CcspTraceError(("[XDNS] syscfg_set XDNS_DNSSecEnable failed!\n")); | ||
| } |
| #if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| { | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0) |
| #if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (is_devicemode_business()) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| { | ||
| if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
source/dmlxdns/cosa_xdns_apis.c:1732
- Same as in
RefreshResolvConfEntry():syscfg_get("MultiProfileXDNS")is unchecked, and informational logging goes directly to stderr. If syscfg access fails this will silently fall back to "Disabled" and can be noisy/unfilterable at runtime. Checking the return code and usingCcspTrace*makes failures visible and keeps logs consistent.
{
char multiprofile_flag[5] = {0};
syscfg_get(NULL, "MultiProfileXDNS", multiprofile_flag, sizeof(multiprofile_flag));
if (multiprofile_flag[0] == '1' && multiprofile_flag[1] == '\0')
{
| { | ||
| char multiprofile_flag[5] = {0}; | ||
| syscfg_get(NULL, "MultiProfileXDNS", multiprofile_flag, sizeof(multiprofile_flag)); | ||
| if (multiprofile_flag[0] == '1' && multiprofile_flag[1] == '\0') | ||
| { |
| #if !defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| else if (!is_devicemode_business() && | ||
| ((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)) && (INVALID_IP != CheckIfIpIsValid(xd->default_ipv6))) || | ||
| ((INVALID_IP != CheckIfIpIsValid(xd->default_ipv4)) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))) || | ||
| ((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))))) | ||
| #else // _ONESTACK_PRODUCT_REQ_ | ||
| else if ((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)) && (INVALID_IP != CheckIfIpIsValid(xd->default_ipv6))) || | ||
| ((INVALID_IP != CheckIfIpIsValid(xd->default_ipv4)) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))) || | ||
| ((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))))) | ||
| #endif // _ONESTACK_PRODUCT_REQ_ | ||
| { |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
source/dmlxdns/cosa_xdns_dml.c:643
- These changes alter the DNSSecEnable behavior specifically for
_ONESTACK_PRODUCT_REQ_builds (removing theis_devicemode_business()gate), but the current unit-test build flags only define_CBR_PRODUCT_REQ_(seesource/test/CcspXdnsDmlTest/Makefile.am:40-44). As a result, the updated residential-vs-business behavior for ONESTACK isn’t exercised by CI unit tests.
Consider adding a unit-test build variant (or targeted tests) that compiles with _ONESTACK_PRODUCT_REQ_ and mocks is_devicemode_business() to cover both device-mode paths for DNSSecEnable get/set.
#if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_)
{
char buf[5] = {0};
if (syscfg_get(NULL, "XDNS_DNSSecEnable", buf, sizeof(buf)) == 0)
{
Reason for change: Enable Multiprofile XDNS bridges by default in XB10
Test Procedure: Residential and Business devicemode needs to be tested.
Functionality of the following DMLs need to be tested:
Above mentioned DML parameters SHOULD work in both residential and business devicemode.
Risks: Low
Priority: P1
Signed-off-by:Nithishkumar_Thirumoorthi@comcast.com