-
Notifications
You must be signed in to change notification settings - Fork 54
RDKB-63098: Handle IPv6 delegation for business vs residential Partner ID as part of single build #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
RDKB-63098: Handle IPv6 delegation for business vs residential Partner ID as part of single build #188
Changes from all commits
f94161f
f9a3130
a1b376b
d49b7ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,9 @@ | |||||
| #include <string.h> | ||||||
| #include <unistd.h> | ||||||
| #include "secure_wrapper.h" | ||||||
|
|
||||||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||||||
| #include <rdkb_feature_mode_gate.h> | ||||||
| #endif | ||||||
| #if defined(_DT_WAN_Manager_Enable_) | ||||||
| int _get_shell_output2(char * cmd, char * dststr) | ||||||
| { | ||||||
|
|
@@ -226,12 +228,16 @@ WanMgr_DmlDhcpv6Init | |||||
| { | ||||||
| DSLHDMAGNT_CALLBACK * pEntry = NULL; | ||||||
| CcspTraceWarning(("Inside %s %d \n", __FUNCTION__, __LINE__)); | ||||||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_) && ! defined(_BCI_FEATURE_REQ) | ||||||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_) && ! defined(_BCI_FEATURE_REQ) && !defined(_ONESTACK_PRODUCT_REQ_) | ||||||
|
|
||||||
| #else | ||||||
| /* handle message from wan dchcp6 client */ | ||||||
| WanMgr_DmlDhcpv6SMsgHandler(NULL); | ||||||
|
|
||||||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||||||
|
||||||
| #ifdef _ONESTACK_PRODUCT_REQ_ | |
| #ifdef _ONESTACK_PRODUCT_REQ_ |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this section uses mixed indentation styles - preprocessor directives with leading spaces and inconsistent indentation of the if statement and braces. This should be normalized to follow consistent indentation standards throughout the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More build flags?
Why can't we write a generic code?
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,7 +38,10 @@ extern token_t sysevent_token; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| extern ANSC_HANDLE bus_handle; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| extern char g_Subsystem[32]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && defined(_COSA_BCM_MIPS_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <rdkb_feature_mode_gate.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #if (defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && defined(_COSA_BCM_MIPS_)) || defined(_ONESTACK_PRODUCT_REQ_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <netinet/in.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #define CLIENT_DUID_FILE "/var/lib/dibbler/client-duid" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -444,15 +447,31 @@ static int _dibbler_client_operation(char * arg) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CcspTraceInfo(("%s stop\n", __func__)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /*TCXB6 is also calling service_dhcpv6_client.sh but the actuall script is installed from meta-rdk-oem layer as the intel specific code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /*TCXB6 is also calling service_dhcpv6_client.sh but the actuall script is installed from meta-rdk-oem layer as the intel specific code | |
| /*TCXB6 is also calling service_dhcpv6_client.sh but the actual script is installed from meta-rdk-oem layer as the intel specific code |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an empty line (line 453) inside the if block that serves no purpose. This should be removed to maintain clean code formatting and consistency with the rest of the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What service_dhcpv6_client.sh script is resposible for?
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this block uses tabs instead of spaces, which is inconsistent with the surrounding code. Lines 451-464 appear to use hard tabs, while the codebase generally uses spaces for indentation (e.g., lines 447, 476-477). This inconsistency should be corrected to maintain uniform code style.
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| { | |
| sysevent_set(sysevent_fd, sysevent_token, "dhcpv6_client-stop", "", 0); | |
| } | |
| else | |
| { | |
| #if defined(CORE_NET_LIB) | |
| v_secure_system("/usr/bin/service_dhcpv6_client dhcpv6_client_service_disable"); | |
| CcspTraceInfo(("%s Calling service_dhcpv6_client.c with dhcpv6_client_service_disable from wanmgr_dhcpv6_apis.c\n", __func__)); | |
| #else | |
| v_secure_system("/etc/utopia/service.d/service_dhcpv6_client.sh disable &"); | |
| #endif | |
| } | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| { | |
| sysevent_set(sysevent_fd, sysevent_token, "dhcpv6_client-stop", "", 0); | |
| } | |
| else | |
| { | |
| #if defined(CORE_NET_LIB) | |
| v_secure_system("/usr/bin/service_dhcpv6_client dhcpv6_client_service_disable"); | |
| CcspTraceInfo(("%s Calling service_dhcpv6_client.c with dhcpv6_client_service_disable from wanmgr_dhcpv6_apis.c\n", __func__)); | |
| #else | |
| v_secure_system("/etc/utopia/service.d/service_dhcpv6_client.sh disable &"); | |
| #endif | |
| } |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "Callin" should be "Calling". This typo exists in the comment on line 569 and is visible in the context of this change.
| CcspTraceInfo(("%s Callin service_dhcpv6_client.sh enable \n", __func__)); | |
| CcspTraceInfo(("%s Calling service_dhcpv6_client.sh enable \n", __func__)); |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace after "else" on line 575. This should be removed to maintain clean code formatting.
| else | |
| else |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this block uses tabs instead of spaces, which is inconsistent with the surrounding code. The same indentation inconsistency found in the "stop" operation above is repeated here. Lines 570-584 should use spaces for indentation to match the codebase style.
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| { | |
| sysevent_set(sysevent_fd, sysevent_token, "dhcpv6_client-start", "", 0); | |
| } | |
| else | |
| { | |
| #if defined(CORE_NET_LIB) | |
| v_secure_system("/usr/bin/service_dhcpv6_client dhcpv6_client_service_enable"); | |
| CcspTraceInfo(("%s Calling service_dhcpv6_client.c with dhcpv6_client_service_enable from wanmgr_dhcpv6_apis.c\n", __func__)); | |
| #else | |
| v_secure_system("/etc/utopia/service.d/service_dhcpv6_client.sh enable &"); | |
| #endif | |
| } | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| { | |
| sysevent_set(sysevent_fd, sysevent_token, "dhcpv6_client-start", "", 0); | |
| } | |
| else | |
| { | |
| #if defined(CORE_NET_LIB) | |
| v_secure_system("/usr/bin/service_dhcpv6_client dhcpv6_client_service_enable"); | |
| CcspTraceInfo(("%s Calling service_dhcpv6_client.c with dhcpv6_client_service_enable from wanmgr_dhcpv6_apis.c\n", __func__)); | |
| #else | |
| v_secure_system("/etc/utopia/service.d/service_dhcpv6_client.sh enable &"); | |
| #endif | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the rdk design, we control the features based on the PSM/other DB internal to the app.
Why do we need all these implementations just to know if a platform supports prefix delegation?
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this block uses tabs instead of spaces, which is inconsistent with the surrounding code. Lines 1811-1828 appear to use hard tabs for indentation, while the codebase generally uses spaces for indentation. This inconsistency should be corrected to maintain uniform code style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we setting ipv6_prefix from wan manager, it should be ideally set from DHCP manager when DHCP manager is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @snayak002c
This is correct as per the latest dhcp-manager design working along with other RDK components.
The earlier implementation of the dhcp-manager, trying to replace RDK WAN components, has been deprecated and removed.
Please refer to the links below for the DHCP Manager design.
https://github.com/rdkcentral/dhcp-manager/tree/develop/docs
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this block uses tabs instead of spaces, which is inconsistent with the surrounding code. This inconsistency should be corrected to maintain uniform code style.
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| /* Use the delegated prefix length directly for platforms that support prefix delegation to LAN clients */ | |
| strncpy(lanPrefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(lanPrefix) - 1); | |
| } | |
| #endif | |
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | |
| #if defined(_ONESTACK_PRODUCT_REQ_) | |
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| strncat(lanPrefix, "/64", sizeof(lanPrefix) - strlen(lanPrefix) - 1); | |
| } | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| /* Use the delegated prefix length directly for platforms that support prefix delegation to LAN clients */ | |
| strncpy(lanPrefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(lanPrefix) - 1); | |
| } | |
| #endif | |
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | |
| #if defined(_ONESTACK_PRODUCT_REQ_) | |
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| strncat(lanPrefix, "/64", sizeof(lanPrefix) - strlen(lanPrefix) - 1); | |
| } |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this block uses tabs instead of spaces, which is inconsistent with the surrounding code. This inconsistency should be corrected to maintain uniform code style.
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| /* Use the delegated prefix length directly for platforms that support prefix delegation to LAN clients */ | |
| strncpy(prefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(prefix) - 1); | |
| } | |
| #endif | |
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | |
| #if defined(_ONESTACK_PRODUCT_REQ_) | |
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| strncat(prefix, "/64", sizeof(prefix) - 1); | |
| } | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| /* Use the delegated prefix length directly for platforms that support prefix delegation to LAN clients */ | |
| strncpy(prefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(prefix) - 1); | |
| } | |
| #endif | |
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | |
| #if defined(_ONESTACK_PRODUCT_REQ_) | |
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| strncat(prefix, "/64", sizeof(prefix) - 1); | |
| } |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace after the opening brace on line 2203. This should be removed to maintain clean code formatting.
| { | |
| { |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this block uses tabs instead of spaces, which is inconsistent with the surrounding code. This inconsistency should be corrected to maintain uniform code style.
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was changed from using spaces to tabs for indentation. This change appears unrelated to the OneStack feature being added and creates inconsistency with line 2239 which still uses spaces. It would be better to keep the original indentation or ensure both lines use the same indentation style.
| CcspTraceError(("%s %d - Invalid memory \n", __FUNCTION__, __LINE__)); | |
| CcspTraceError(("%s %d - Invalid memory \n", __FUNCTION__, __LINE__)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these libraries?
What is the difference between existing rdk libaraies?