Skip to content

RDKB-63098: [ONESTACK]-Handle IPv6 delegation for business vs residential Partner ID as part of single build#238

Open
rirfha948 wants to merge 5 commits intodevelopfrom
topic/onestack_pd
Open

RDKB-63098: [ONESTACK]-Handle IPv6 delegation for business vs residential Partner ID as part of single build#238
rirfha948 wants to merge 5 commits intodevelopfrom
topic/onestack_pd

Conversation

@rirfha948
Copy link
Contributor

@rirfha948 rirfha948 commented Feb 24, 2026

Reason for change: Prefix delegation handling
Test Procedure:

  • Build OneStack Image

  • In Business-mode, Check dibbler server is started and server.conf has prefix-delegation class

  • In Residential-mode, check whether device behaves as a non-CBR device Risks: None
    Priority: P1

  • Is this a User Story (US)?

  • Have all dependent PRs from other components been listed ?
    RDKB-63098-changes.xlsx

  • Does the commit message include both the User Story ticket and the Subtask ticket?

  • Will be all changes related to the User Story squashed and merged in a single commit?

  • Has the PR been raised only after completing all changes for the User Story (no partial changes)?

  • Has code development for the User Story been completed?

  • If yes, has the Gerrit topic or list of all dependent PRs across components (including meta-layer changes) been shared?

  • Is there a validation log available in the Jira ticket for verifying builds with the updated generic-srcrev.inc across all platforms?
    RDKB-63098-logs.txt

            vs residential Partner ID as part of single build

Reason for change: Prefix delegation handling
Test Procedure:
  - Build OneStack Image
  - In Business-mode, Check dibbler server is started and server.conf
    has prefix-delegation class
  - In Residential-mode,  check whether device behaves as a non-CBR device
Risks: None
Priority: P1
Signed-off-by: rirfha948 <rasina_irfhan@comcast.com>
@rirfha948 rirfha948 marked this pull request as ready for review February 26, 2026 14:38
@rirfha948 rirfha948 requested review from a team as code owners February 26, 2026 14:38
Copilot AI review requested due to automatic review settings February 26, 2026 14:38
Copy link
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

Adds OneStack-aware IPv6 prefix delegation handling, toggling behavior between “business” (PD enabled) and “residential” (PD disabled) modes in a single build.

Changes:

  • Gate PD-related routed/IPv6/firewall behavior at runtime via rdkb_feature_mode_gate (FEATURE_IPV6_DELEGATION).
  • Register different sysevent custom events for business vs residential mode (including new ipv6_prefix_delegation event).
  • Update build/link integration to include OneStack libraries when ONESTACK_PRODUCT_REQ is enabled.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
source/util/utils/Makefile.am Links OneStack feature/mode-gate libs when enabled
source/service_routed/service_routed.c Runtime-gates PD vs non-PD code paths
source/service_routed/Makefile.am Adds include/link flags and OneStack libs
source/service_ipv6/service_ipv6.c Runtime-gates PD behavior; updates helper and start/stop logic
source/service_ipv6/Makefile.am Links OneStack feature/mode-gate libs when enabled
source/scripts/init/service.d/service_routed_bci.sh Adds ipv6_prefix_delegation event handling; expands model list
source/scripts/init/service.d/service_registration_functions.sh Adds debug prints during event registration
source/scripts/init/service.d/service_dhcpv6_server_bci.sh Adds ipv6_prefix_delegation event handling; expands model list
source/scripts/init/service.d/service_crond.sh Expands model list for cron entry
source/scripts/init/c_registration/Makefile.am Links OneStack feature/mode-gate libs when enabled
source/scripts/init/c_registration/20_routing.c Chooses custom events list based on PD feature mode
source/scripts/init/c_registration/15_dhcpv6_server.c Chooses custom events list based on PD feature mode
source/scripts/init/c_registration/15_dhcpv6_client.c Enables client custom events under OneStack
source/firewall/firewall_ipv6.c Runtime-gates multinet firewall rules under OneStack
source/firewall/firewall.h Exposes multinet firewall prototype for OneStack builds
source/firewall/Makefile.am Links OneStack feature/mode-gate libs when enabled

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

"dhcpv6_server-stop|/etc/utopia/service.d/service_dhcpv6_server_bci.sh",
"dhcpv6_server-restart|/etc/utopia/service.d/service_dhcpv6_server_bci.sh",
"ipv6_prefix_delegation|/etc/utopia/service.d/service_dhcpv6_server_bci.sh",
"dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server_bci.sh|NULL|"TUPLE_FLAG_EVENT,NULL
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

This array initializer is syntactically invalid: the final element combines a string literal and NULL without a separating comma, which will fail compilation. Split the last entry into a string element and a separate NULL terminator (and ensure the TUPLE_FLAG_EVENT concatenation remains part of the string literal).

Suggested change
"dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server_bci.sh|NULL|"TUPLE_FLAG_EVENT,NULL
"dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server_bci.sh|NULL|"TUPLE_FLAG_EVENT,
NULL

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +50
#if defined(_ONESTACK_PRODUCT_REQ_)
const char** SERVICE_CUSTOM_EVENTS = NULL;
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Under configurations where _ONESTACK_PRODUCT_REQ_ and CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION are both defined, this will produce a redefinition of SERVICE_CUSTOM_EVENTS with incompatible types (const char** vs const char* []). Refactor to define SERVICE_CUSTOM_EVENTS exactly once via a single #if / #elif / #else chain, and consider using const char* const *SERVICE_CUSTOM_EVENTS for the pointer form to preserve const-correctness.

Suggested change
#if defined(_ONESTACK_PRODUCT_REQ_)
const char** SERVICE_CUSTOM_EVENTS = NULL;
#if defined(_ONESTACK_PRODUCT_REQ_) && !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
const char* const *SERVICE_CUSTOM_EVENTS = NULL;

Copilot uses AI. Check for mistakes.
Comment on lines +45 to 50
#if defined(_ONESTACK_PRODUCT_REQ_)
const char** SERVICE_CUSTOM_EVENTS = NULL;
#endif

#if defined(_CBR_PRODUCT_REQ_) && !defined(_CBR2_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

This introduces the same potential symbol clash as in 20_routing.c: if _ONESTACK_PRODUCT_REQ_ is defined alongside another branch that defines SERVICE_CUSTOM_EVENTS[], compilation will fail due to redefinition. Prefer a single compile-time selection that declares SERVICE_CUSTOM_EVENTS once, and use a const-correct pointer type (const char* const *) when you need to re-point it at different static arrays.

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +73
"routeset-ula|/usr/bin/service_routed|NULL|"TUPLE_FLAG_EVENT,
"routeunset-ula|/usr/bin//service_routed|NULL|"TUPLE_FLAG_EVENT,
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The routeunset-ula handler path contains a double slash (/usr/bin//service_routed). While it may resolve on many systems, it’s an easy source of inconsistency and can break path comparisons/tools. Use /usr/bin/service_routed.

Copilot uses AI. Check for mistakes.
Comment on lines +263 to +264
#if defined( _CBR_PRODUCT_REQ_) || defined (_ONESTACK_PRODUCT_REQ_)
STATIC uint64_t helper_ntoh64(const long long unsigned int *inputval)
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Changing the parameter type from const uint64_t * to const long long unsigned int * is not portable: uint64_t is not guaranteed to be unsigned long long on all toolchains, and this can introduce incompatible-pointer warnings/errors at call sites. Keep the parameter as const uint64_t * (or change to a byte-oriented type like const uint8_t */const void * since the implementation treats it as raw bytes).

Copilot uses AI. Check for mistakes.

STATIC int serv_ipv6_stop(struct serv_ipv6 *si6)
{
fprintf(stderr, "Entered serv_ipv6_stop \n");
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

These unconditional fprintf(stderr, ...) debug prints will spam logs in production and are inconsistent with the rest of the service logging patterns. Please gate them behind an existing debug macro/compile flag (or remove them) and use the project’s standard logging facility if available.

Suggested change
fprintf(stderr, "Entered serv_ipv6_stop \n");

Copilot uses AI. Check for mistakes.
return 0
fi

echo "[DEBUG] sm_rm_event ${SMR_SERVICE} ${SMR_EVENT_NAME}"
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

These debug echo statements are unconditional and will add noise to boot/service manager logs on all devices. Consider guarding them behind a debug flag/environment variable (or using an existing structured logger like ulog if that’s the convention for this repo).

Suggested change
echo "[DEBUG] sm_rm_event ${SMR_SERVICE} ${SMR_EVENT_NAME}"
ulog srvmgr status "[DEBUG] sm_rm_event ${SMR_SERVICE} ${SMR_EVENT_NAME}"

Copilot uses AI. Check for mistakes.
IFS=';'
for custom in $SM_CUSTOM_EVENTS ; do
if [ -n "$custom" ] && [ " " != "$custom" ] ; then
echo "[DHCPV6][DEBUG] Registering custom event: '$custom' for service '$SM_SERVICE'"
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

These debug echo statements are unconditional and will add noise to boot/service manager logs on all devices. Consider guarding them behind a debug flag/environment variable (or using an existing structured logger like ulog if that’s the convention for this repo).

Suggested change
echo "[DHCPV6][DEBUG] Registering custom event: '$custom' for service '$SM_SERVICE'"
ulog dhcpv6 debug "Registering custom event: '$custom' for service '$SM_SERVICE'"

Copilot uses AI. Check for mistakes.
-I$(top_srcdir)/source/util/utils \
$(DBUS_CFLAGS)

AM_LDFLAGS = -lsecure_wrapper -lccsp_common $(DBUS_LIBS)
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

These Makefile changes put libraries (-l...) into AM_LDFLAGS / service_routed_LDFLAGS. In Automake, *_LDFLAGS is intended for linker flags (e.g., -L, -Wl, options), while libraries should generally go into *_LDADD (or LIBS). Moving -lccsp_common, $(DBUS_LIBS), -lnet, and the OneStack libraries to service_routed_LDADD will avoid link-order issues and align with standard Automake conventions.

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +52
service_routed_LDFLAGS = -L${PKG_CONFIG_SYSROOT_DIR}${libdir}
if ONESTACK_PRODUCT_REQ
service_routed_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
endif
if CORE_NET_LIB_FEATURE_SUPPORT
service_routed_LDFLAGS = -lnet
service_routed_LDFLAGS += -lnet
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

These Makefile changes put libraries (-l...) into AM_LDFLAGS / service_routed_LDFLAGS. In Automake, *_LDFLAGS is intended for linker flags (e.g., -L, -Wl, options), while libraries should generally go into *_LDADD (or LIBS). Moving -lccsp_common, $(DBUS_LIBS), -lnet, and the OneStack libraries to service_routed_LDADD will avoid link-order issues and align with standard Automake conventions.

Copilot uses AI. Check for mistakes.
            vs residential Partner ID as part of single build

Reason for change: Prefix delegation handling
Test Procedure:
  - Build OneStack Image
  - In Business-mode, Check dibbler server is started and server.conf
    has prefix-delegation class
  - In Residential-mode,  check whether device behaves as a non-CBR device
Risks: None
Priority: P1
Signed-off-by: rirfha948 <rasina_irfhan@comcast.com>
Copilot AI review requested due to automatic review settings February 27, 2026 09:25
Copy link
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 14 out of 14 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

source/service_routed/service_routed.c:1795

  • Inconsistent indentation and formatting. The 'if' statement on line 1786 is not indented properly, and the variable declarations starting at line 1789 should follow standard C89/C90 convention of being declared at the beginning of the block (before any executable statements), or the code should be compiled with C99 or later standards. Consider adding proper indentation and following the code style of the surrounding context.
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
#endif
{
char cmd[100];
char out[100];
char interface_name[32] = {0};
char *token = NULL; 
char *pt;
char pref_rx[16];


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

"ipv6_ntp_server|/etc/utopia/service.d/service_dhcpv6_server.sh",
"dhcp_domain|/etc/utopia/service.d/service_dhcpv6_server.sh",
"current_lan_ipv6address|/etc/utopia/service.d/service_dhcpv6_server.sh",
NULL
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation in array. Line 70 uses a tab character while surrounding lines use spaces. This creates visual inconsistency and should be standardized to match the indentation style of the rest of the array.

Suggested change
NULL
NULL

Copilot uses AI. Check for mistakes.
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", iface_name);
#else
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name);
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Missing space in the preprocessor directive condition. The code has '#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(ONESTACK_PRODUCT_REQ)' with two spaces after '||'. While this doesn't cause a compilation error, it's inconsistent with the single space used elsewhere in the file.

Copilot uses AI. Check for mistakes.
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", iface_name);
}
#endif
#if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent spacing in preprocessor directive. This line has two spaces after '||' while other similar conditions use a single space. Consider using consistent spacing throughout.

Suggested change
#if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
#if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)

Copilot uses AI. Check for mistakes.
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == false)
#endif
{
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name);
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation. This line uses a tab character for indentation while the surrounding code uses spaces. This creates visual inconsistency and can cause issues with different editor tab settings.

Suggested change
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name);
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name);

Copilot uses AI. Check for mistakes.
Comment on lines 2108 to 2400
@@ -2098,10 +2125,17 @@ STATIC int serv_ipv6_start(struct serv_ipv6 *si6)
sysevent_set(si6->sefd, si6->setok, "service_ipv6-status", "starting", 0);

/* Fix for IPv6 prefix not getting updated in dibbler server conf file on WAN mode change */
#if defined(_CBR2_PRODUCT_REQ_)
#if defined(_CBR2_PRODUCT_REQ_)
sysevent_get(si6->sefd, si6->setok, "ipv6_prefix", si6->mso_prefix, sizeof(si6->mso_prefix));
sysevent_set(si6->sefd, si6->setok, "ipv6_prefix-divided", "", 0);
#endif
#if defined(_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
{
sysevent_get(si6->sefd, si6->setok, "ipv6_prefix_delegation", si6->mso_prefix, sizeof(si6->mso_prefix));
sysevent_set(si6->sefd, si6->setok, "ipv6_prefix-divided", "", 0);
}
#endif

/*
* Update MTU of all the enabled IPv6 instances
@@ -2118,13 +2152,22 @@ STATIC int serv_ipv6_start(struct serv_ipv6 *si6)
* 5) Send RA, start DHCPv6 server
*/
/* For CBR product the lan(brlan0) v6 address set is done as part of PandM process*/
#if !defined(_CBR_PRODUCT_REQ_) && !defined(_BWG_PRODUCT_REQ_)
#if !defined(_CBR_PRODUCT_REQ_) && !defined(_BWG_PRODUCT_REQ_) && !defined(_ONESTACK_PRODUCT_REQ_)
if (lan_addr6_set(si6) !=0) {
fprintf(stderr, "assign IPv6 address for lan interfaces error!\n");
sysevent_set(si6->sefd, si6->setok, "service_ipv6-status", "error", 0);
return -1;
}
#endif
#if defined (_ONESTACK_PRODUCT_REQ_)
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)){
if (lan_addr6_set(si6) !=0) {
fprintf(stderr, "assign IPv6 address for lan interfaces error!\n");
sysevent_set(si6->sefd, si6->setok, "service_ipv6-status", "error", 0);
return -1;
}
}
#endif

//Intel Proposed RDKB Generic Bug Fix from XB6 SDK
/*start zebra*/
@@ -2152,6 +2195,7 @@ STATIC int serv_ipv6_start(struct serv_ipv6 *si6)

STATIC int serv_ipv6_stop(struct serv_ipv6 *si6)
{
fprintf(stderr, "Entered serv_ipv6_stop \n");
if (!serv_can_stop(si6->sefd, si6->setok, "service_ipv6"))
return -1;

@@ -2162,7 +2206,7 @@ STATIC int serv_ipv6_stop(struct serv_ipv6 *si6)
sysevent_set(si6->sefd, si6->setok, "service_ipv6-status", "error", 0);
return -1;
}
#if !defined(_CBR_PRODUCT_REQ_) && !defined(_BWG_PRODUCT_REQ_)
#if !defined(_CBR_PRODUCT_REQ_) && !defined(_BWG_PRODUCT_REQ_) && !defined(_ONESTACK_PRODUCT_REQ_)
del_addr6_flg = false;
if (lan_addr6_unset(si6) !=0) {
fprintf(stderr, "unset IPv6 address for lan interfaces error!\n");
@@ -2171,6 +2215,18 @@ STATIC int serv_ipv6_stop(struct serv_ipv6 *si6)
return -1;
}
del_addr6_flg = true;
#endif
#if defined (_ONESTACK_PRODUCT_REQ_)
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)){
del_addr6_flg = false;
if (lan_addr6_unset(si6) !=0) {
fprintf(stderr, "unset IPv6 address for lan interfaces error!\n");
sysevent_set(si6->sefd, si6->setok, "service_ipv6-status", "error", 0);
del_addr6_flg = true;
return -1;
}
del_addr6_flg = true;
}
#endif
sysevent_set(si6->sefd, si6->setok, "service_ipv6-status", "stopped", 0);
return 0;
@@ -2219,12 +2275,28 @@ STATIC int serv_ipv6_init(struct serv_ipv6 *si6)
return -1;
#endif
}

#if defined (_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
{
sysevent_get(si6->sefd, si6->setok, "ipv6_prefix_delegation", si6->mso_prefix, sizeof(si6->mso_prefix));
}
else
{
sysevent_get(si6->sefd, si6->setok, "ipv6_prefix", si6->mso_prefix, sizeof(si6->mso_prefix));
}
#else
sysevent_get(si6->sefd, si6->setok, "ipv6_prefix", si6->mso_prefix, sizeof(si6->mso_prefix));
#endif
fprintf(stderr, "IPv6 Prefix :%s\n", si6->mso_prefix);
if (strlen(si6->mso_prefix))
{
si6->wan_ready = true;
}
else
{
fprintf(stderr, "[%s] -- Init ipv6_prefix retrieval failed\n", PROG_NAME);
return -1;
}

sysevent_get(si6->sefd, si6->setok, "erouter_topology-mode", buf, sizeof(buf));
switch(atoi(buf)) {
@@ -2307,8 +2379,10 @@ int service_ipv6_main(int argc, char *argv[])
}

if (serv_ipv6_init(&si6) != 0)
{
fprintf(stderr, "[%s] -- Service IPV6 Initialization failed\n", PROG_NAME);
exit(1);

}
for (i = 0; i < NELEMS(cmd_ops); i++) {
if (strcmp(argv[1], cmd_ops[i].cmd) != 0 || !cmd_ops[i].exec)
continue;
@@ -2323,6 +2397,7 @@ int service_ipv6_main(int argc, char *argv[])
if (i == NELEMS(cmd_ops))
fprintf(stderr, "[%s] unknown command: %s\n", PROG_NAME, argv[1]);

fprintf(stderr, "[%s] -- DHCPv6 start in progress\n", PROG_NAME);
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The debug fprintf statements added throughout this function should be removed or converted to proper logging. Debug print statements left in production code can impact performance and clutter logs. Consider using a conditional debug macro or removing these before merging.

Copilot uses AI. Check for mistakes.
IFS=';'
for custom in $SM_CUSTOM_EVENTS ; do
if [ -n "$custom" ] && [ " " != "$custom" ] ; then
echo "[DHCPV6][DEBUG] Registering custom event: '$custom' for service '$SM_SERVICE'"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Debug echo statements are being added to shell scripts. These should be removed or made conditional before production deployment to avoid cluttering logs and potentially exposing sensitive information.

Suggested change
echo "[DHCPV6][DEBUG] Registering custom event: '$custom' for service '$SM_SERVICE'"

Copilot uses AI. Check for mistakes.
Comment on lines +1491 to +1501
#if defined (_COSA_BCM_MIPS_)
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
// For CBR platform, the captive portal redirection feature was removed
// inWifiCp = 1;
#else
inWifiCp = 1;
inWifiCp = 1;
#endif
#else
inWifiCp = 1;
inWifiCp = 1;
#endif
}
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation: this code block uses tab characters while the surrounding code may use spaces. The lines 1491-1501 should use consistent indentation matching the rest of the file to maintain code style uniformity.

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +75
#ifdef WAN_FAILOVER_SUPPORTED
"routeset-ula|/usr/bin/service_routed|NULL|"TUPLE_FLAG_EVENT,
"routeunset-ula|/usr/bin//service_routed|NULL|"TUPLE_FLAG_EVENT,
#endif
NULL
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Using preprocessor directives inside array initialization is non-standard and could cause compilation issues or unexpected behavior depending on the compiler. If WAN_FAILOVER_SUPPORTED is not defined, this will result in a trailing comma before NULL, which while typically handled by most C compilers, is technically a C99 feature and may not be portable. Consider defining two complete separate arrays or restructuring to avoid conditionals within the array.

Copilot uses AI. Check for mistakes.
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_)
static int prepare_ipv6_multinet(FILE *fp)
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)
int prepare_ipv6_multinet(FILE *fp)
Copy link
Contributor

Choose a reason for hiding this comment

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

why static was removed?

15_hotspot_SOURCES = 15_hotspot.c
endif
if ONESTACK_PRODUCT_REQ
LDFLAGS += -lrdkb_feature_mode_gate -ldevicemode
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the -ldevicemode library required?



if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ]; then
if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$MODEL_NUM" = "SG417DBCT" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Only Sercomm XB10 has been added here. How about Vantiva XB10? Also are we going with "model" based approach or "onestack feature" related approach?

case "$1" in
"${SERVICE_NAME}-start")
if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ]; then
if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$MODEL_NUM" = "SG417DBCT" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

;;
"${SERVICE_NAME}-stop")
if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ]; then
if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$MODEL_NUM" = "SG417DBCT" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

}

STATIC uint64_t helper_hton64(const uint64_t *inputval)
STATIC uint64_t helper_hton64(const long long unsigned int *inputval)
Copy link
Contributor

Choose a reason for hiding this comment

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

AM_LDFLAGS = -lsecure_wrapper
AM_CPPFLAGS = -I$(top_srcdir)/source/include \
-I$(top_srcdir)/source/util/utils \
$(DBUS_CFLAGS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes mandatory?

-ltelemetry_msgsender
service_routed_LDFLAGS = -L${PKG_CONFIG_SYSROOT_DIR}${libdir}
if ONESTACK_PRODUCT_REQ
service_routed_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need all these libraries

#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION

#ifdef WAN_FAILOVER_SUPPORTED
char last_broadcasted_prefix[64] = {0};
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this variable moved here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

faced issue by introducing {}. Scope error. Example:
int function()
{
#if defined(BUSINESS_FEATURE) || defined(ONESTACK_PRODUCT_REQ)
if (business_mode)
{
int a = 0; // now inside block
a = 5;
}
#endif

printf("%d\n", a);   // :x: COMPILER ERROR, Variable lives only inside block
return 0;

}

libutopiautil_la_LDFLAGS = -lccsp_common $(DBUS_LIBS)

if ONESTACK_PRODUCT_REQ
libutopiautil_la_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need all these libs?

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.

4 participants