Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/firewall/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ firewall_SOURCES += firewall_lib.c firewall_dsl.c rabid.c
AM_LDFLAGS += -lrdkconfig
endif

if ONESTACK_PRODUCT_REQ
AM_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
endif
nfq_handler_SOURCES = raw_socket_send.c nfq_handler.c

firewall_LDADD = $(top_builddir)/source/syscfg/lib/libsyscfg.la \
Expand Down
3 changes: 2 additions & 1 deletion source/firewall/firewall.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ int prepare_multinet_filter_output_v6(FILE *fp);
*/
int prepare_ipv6_rule_ex_mode(FILE *raw_fp, FILE *mangle_fp, FILE *nat_fp, FILE *filter_fp);
#endif
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)
#if (defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)) \
|| defined(_ONESTACK_PRODUCT_REQ_)
/**
* @brief Prepare IPv6 MultiNet rules with DHCPv6 prefix delegation support.
*
Expand Down
25 changes: 21 additions & 4 deletions source/firewall/firewall_ipv6.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/firewall/firewall_ipv6.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/firewall/firewall_ipv6.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 2460 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-TEST-RELEASE-1.tar.gz, file: source/firewall/firewall.c)

Check failure on line 2 in source/firewall/firewall_ipv6.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/firewall/firewall_ipv6.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 2460 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/firewall/firewall.c)
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
Expand Down Expand Up @@ -98,6 +98,9 @@
#include <net/if.h>
#endif

#ifdef _ONESTACK_PRODUCT_REQ_
#include <rdkb_feature_mode_gate.h>
#endif
void* bus_handle ;
int sysevent_fd;
char sysevent_ip[19];
Expand Down Expand Up @@ -862,11 +865,17 @@
}
#endif /*_HUB4_PRODUCT_REQ_*/

#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_)
#if (defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if ( isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == true)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Inconsistent boolean comparison style: This explicit comparison with 'true' is inconsistent with other calls to isFeatureSupportedInCurrentMode() in this PR. For example, line 433 in service_routed.c omits the '== true'. For consistency, either use the explicit comparison everywhere or omit it everywhere. If the function returns a boolean type, the explicit comparison is redundant.

Suggested change
if ( isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == true)
if ( isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) )

Copilot uses AI. Check for mistakes.
#endif
{

/*Add a simple logic here to make traffic allowed for lan interfaces
* exclude primary lan*/
prepare_ipv6_multinet(fp);
#endif
}
#endif
#if !defined(_XER5_PRODUCT_REQ_) && !defined (_SCER11BEL_PRODUCT_REQ_) && !defined(_COSA_QCA_ARM_) //wan0 is not applicable for XER5
/* not allow ping wan0 from brlan0 */
int i;
Expand Down Expand Up @@ -1705,9 +1714,17 @@
FIREWALL_DEBUG("Exiting prepare_ipv6_firewall \n");
}

#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_)) \
|| defined(_ONESTACK_PRODUCT_REQ_)
int prepare_ipv6_multinet(FILE *fp)
{
#ifdef _ONESTACK_PRODUCT_REQ_
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
{
/* PD feature disabled */
return 0;
}
#endif
Comment on lines +1719 to +1727
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Within prepare_ipv6_multinet(), the code later does a do/while loop that formats with the first token from strtok(active_insts, " "). If the sysevent value "multinet-instances" is empty, strtok returns NULL and that loop will dereference a NULL pointer. Add an early return when the first token is NULL (or switch to a while(token != NULL) loop).

Copilot uses AI. Check for mistakes.
char active_insts[32] = {0};
char lan_pd_if[128] = {0};
char *p = NULL;
Comment on lines +1719 to 1730
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

In prepare_ipv6_multinet(), after p = strtok(active_insts, " ") the code uses a do { ... } while (...) loop further down. If active_insts is empty, p will be NULL and the first iteration will still execute, leading to undefined behavior when formatting %s with p. Add a NULL check before entering the loop or convert to while (p != NULL) so an empty instance list is handled safely.

Copilot uses AI. Check for mistakes.
Expand Down
2 changes: 1 addition & 1 deletion source/scripts/init/c_registration/15_dhcpv6_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const char* SERVICE_CUSTOM_EVENTS[] = {
"lan-status|/usr/bin/service_dhcpv6_client",
NULL
};
#elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
#elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
"erouter_mode-updated|/etc/utopia/service.d/service_dhcpv6_client.sh",
"phylink_wan_state|/etc/utopia/service.d/service_dhcpv6_client.sh",
Expand Down
2 changes: 1 addition & 1 deletion source/scripts/init/c_registration/15_dhcpv6_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const char* SERVICE_CUSTOM_EVENTS[] = {
"dhcpv6_server-restart|/usr/bin/service_ipv6",
NULL
};
#elif defined (CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
#elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
"dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server.sh|NULL|"TUPLE_FLAG_EVENT,
NULL
Expand Down
2 changes: 1 addition & 1 deletion source/scripts/init/c_registration/20_routing.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/scripts/init/c_registration/20_routing.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/c_registration/20_routing.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 119 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/scripts/init/c_registration/20_routing.c)
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
Expand Down Expand Up @@ -44,7 +44,7 @@
#define SERVICE_NAME "routed"
#define SERVICE_DEFAULT_HANDLER "/etc/utopia/service.d/service_routed.sh"

#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
"wan-status|/etc/utopia/service.d/service_routed.sh",
"lan-status|/etc/utopia/service.d/service_routed.sh",
Expand Down
5 changes: 4 additions & 1 deletion source/service_ipv6/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/source/include \

AM_LDFLAGS = -lccsp_common -lsecure_wrapper $(DBUS_LIBS)

if ONESTACK_PRODUCT_REQ
service_ipv6_LDFLAGS = -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
endif
service_ipv6_SOURCES = service_ipv6.c service_ipv6_main.c

service_ipv6_LDADD = $(top_builddir)/source/util/utils/libutopiautil.la \
Expand All @@ -33,5 +36,5 @@ service_ipv6_LDADD = $(top_builddir)/source/util/utils/libutopiautil.la \
$(top_builddir)/source/syscfg/lib/libsyscfg.la \
$(top_builddir)/source/ulog/libulog.la
if CORE_NET_LIB_FEATURE_SUPPORT
service_ipv6_LDFLAGS = -lnet
service_ipv6_LDFLAGS += -lnet
endif
40 changes: 33 additions & 7 deletions source/service_ipv6/service_ipv6.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************************

Check failure on line 1 in source/service_ipv6/service_ipv6.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/service_ipv6/service_ipv6.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 2355 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/service_ipv6/service_ipv6.c)

Check failure on line 1 in source/service_ipv6/service_ipv6.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/service_ipv6/service_ipv6.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/2101, 2355 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/rdk-dev-2101.tar.gz, file: source/service_ipv6/service_ipv6.c)
If not stated otherwise in this file or this component's Licenses.txt file the
following copyright and licenses apply:

Expand Down Expand Up @@ -53,6 +53,9 @@
#include "ccsp_memory.h"
#endif

#ifdef _ONESTACK_PRODUCT_REQ_
#include <rdkb_feature_mode_gate.h>
#endif
#ifdef _HUB4_PRODUCT_REQ_
#include "ccsp_dm_api.h"
#include "ccsp_custom.h"
Expand Down Expand Up @@ -391,10 +394,21 @@
DHCPV6S_SYSCFG_GETI(DHCPV6S_NAME, "pool", cfg->index, "", 0, "X_RDKCENTRAL_COM_DNSServersEnabled", cfg->X_RDKCENTRAL_COM_DNSServersEnabled);

#ifdef MULTILAN_FEATURE
#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
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 19, 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: There are two spaces between '||' and 'defined(ONESTACK_PRODUCT_REQ)'. For consistency with other preprocessor directives in the codebase, use a single space.

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 defined(_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == true)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Inconsistent boolean comparison style: This explicit comparison with 'true' is inconsistent with other calls to isFeatureSupportedInCurrentMode() in this PR. For example, line 647 in service_routed.c omits the '== true'. For consistency, either use the explicit comparison everywhere or omit it everywhere. If the function returns a boolean type, the explicit comparison is redundant.

Copilot uses AI. Check for mistakes.
#endif
{
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", iface_name);
}
Comment on lines +397 to +403
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

New ONESTACK runtime gating changes which syscfg key is read (IAInterface vs Interface), but the unit tests under source/test/service_ipv6 don’t appear to cover the ONESTACK path. Please add tests that mock isFeatureSupportedInCurrentMode() for both enabled/disabled and verify the expected DHCPV6S_SYSCFG_GETS key is used.

Copilot uses AI. Check for mistakes.
#endif
#if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
Copy link

Copilot AI Feb 19, 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: There are two spaces between '||' and 'defined(ONESTACK_PRODUCT_REQ)'. For consistency with other preprocessor directives in the codebase, use a single space.

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 defined(_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == false)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Inconsistent boolean comparison style: This explicit comparison with 'false' is inconsistent with other calls to isFeatureSupportedInCurrentMode() in this PR. For example, line 462 in service_routed.c uses the negation operator '!'. For consistency, use the negation operator '!' instead of explicit comparison with 'false'.

Suggested change
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == false)
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))

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

Copilot AI Feb 19, 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 instead of spaces. The surrounding code uses spaces (4 spaces per indentation level). Replace the tab with spaces for consistency.

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 +397 to +411
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

ONESTACK-specific behavior is now introduced in get_dhcpv6s_pool_cfg() to choose between IAInterface vs Interface based on FEATURE_IPV6_DELEGATION, but the existing service_ipv6 unit tests don’t build with ONESTACK_PRODUCT_REQ and don’t validate either branch. Add unit tests that exercise both feature states (mocking isFeatureSupportedInCurrentMode) to ensure the correct syscfg key is read.

Copilot uses AI. Check for mistakes.
#endif
#else
DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", cfg->interface);
Expand Down Expand Up @@ -606,7 +620,7 @@
STATIC int get_active_lanif(struct serv_ipv6 *si6, unsigned int insts[], unsigned int *num)
{
int i = 0;
#if !defined(MULTILAN_FEATURE) || defined CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if !defined(MULTILAN_FEATURE) || defined CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION || defined(_ONESTACK_PRODUCT_REQ_)
char active_insts[32] = {0};
char lan_pd_if[128] = {0};
char *p = NULL;
Expand All @@ -628,7 +642,11 @@
unsigned int max_active_if_count = 0;
int primary_l3_instance = 0;

#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
#endif
{
Comment on lines +645 to +649
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

get_active_lanif() now adds ONESTACK-specific runtime branching based on FEATURE_IPV6_DELEGATION. The existing service_ipv6 unit tests don’t appear to cover this new feature-gated behavior; please add tests for ONESTACK builds that exercise both branches (feature enabled vs disabled) and assert the expected sysevent/syscfg calls.

Copilot uses AI. Check for mistakes.
syscfg_get(NULL, "lan_pd_interfaces", lan_pd_if, sizeof(lan_pd_if));
if (lan_pd_if[0] == '\0') {
*num = 0;
Expand All @@ -648,7 +666,14 @@

p = strtok(NULL, " ");
}
#else
}
#endif
#if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
#endif
{

/* Get active bridge count from PSM */
if (!bus_handle) {
fprintf(stderr, "DBUS not connected, returning \n");
Expand Down Expand Up @@ -718,6 +743,7 @@
}
/* Set active IPv6 instances */
sysevent_set(si6->sefd, si6->setok, "ipv6_active_inst", active_if_list, 0);
}
#endif


Expand Down
7 changes: 5 additions & 2 deletions source/service_routed/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

bin_PROGRAMS = service_routed

AM_LDFLAGS = -lsecure_wrapper
AM_LDFLAGS = -lccsp_common -lsecure_wrapper

service_routed_SOURCES = service_routed.c service_routed_main.c

Expand All @@ -40,6 +40,9 @@ service_routed_LDADD = $(top_builddir)/source/util/utils/libutopiautil.la \
$(top_builddir)/source/utctx/lib/libutctx.la \
$(top_builddir)/source/ulog/libulog.la \
-ltelemetry_msgsender
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
endif
Loading
Loading