Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions source/firewall/firewall_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,11 @@ void do_ipv6_filter_table(FILE *fp){
}
#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_)
/*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 @@ -1717,7 +1717,7 @@ void do_ipv6_filter_table(FILE *fp){
FIREWALL_DEBUG("Exiting prepare_ipv6_firewall \n");
}

#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_)
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)
static int prepare_ipv6_multinet(FILE *fp)
{
char active_insts[32] = {0};
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
40 changes: 39 additions & 1 deletion source/scripts/init/c_registration/15_dhcpv6_server.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/15_dhcpv6_server.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/15_dhcpv6_server.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 131 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/02_bridge.c)

Check failure on line 2 in source/scripts/init/c_registration/15_dhcpv6_server.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/15_dhcpv6_server.c' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 131 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/15_dhcpv6_server.c)
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
Expand Down Expand Up @@ -35,10 +35,17 @@

#include <stdio.h>
#include "srvmgr.h"
#ifdef _ONESTACK_PRODUCT_REQ_
#include <rdkb_feature_mode_gate.h>
#endif

const char* SERVICE_NAME = "dhcpv6_server";
const char* SERVICE_DEFAULT_HANDLER = "/etc/utopia/service.d/service_dhcpv6_server.sh";

#if defined(_ONESTACK_PRODUCT_REQ_)
const char** SERVICE_CUSTOM_EVENTS = NULL;
#endif
Comment on lines +45 to +47
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.

For OneStack, SERVICE_CUSTOM_EVENTS is declared as a pointer (const char**), but the file can also define a const char* SERVICE_CUSTOM_EVENTS[] array in other preprocessor branches. If _ONESTACK_PRODUCT_REQ_ is ever combined with those branches, this will be a symbol redefinition compile error. Please adjust the preprocessor logic or rename the OneStack variable so SERVICE_CUSTOM_EVENTS is defined exactly once per build.

Copilot uses AI. Check for mistakes.

#if defined(_CBR_PRODUCT_REQ_) && !defined(_CBR2_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
Comment on lines +45 to 50
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.
"dhcpv6_option_changed|/usr/bin/service_ipv6",
Expand All @@ -47,11 +54,29 @@
"dhcpv6_server-restart|/usr/bin/service_ipv6",
NULL
};
#elif defined (CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
#elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
const char* SERVICE_CUSTOM_EVENTS[] = {
"dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server.sh|NULL|"TUPLE_FLAG_EVENT,
NULL
};
#elif defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS_RESIDENTIAL[] = {
"lan-status|/etc/utopia/service.d/service_dhcpv6_server.sh",
"ipv6_nameserver|/etc/utopia/service.d/service_dhcpv6_server.sh",
"ipv6_domain|/etc/utopia/service.d/service_dhcpv6_server.sh",
"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.
};
const char* SERVICE_CUSTOM_EVENTS_BUSINESS[] = {
"dhcpv6_server-start|/etc/utopia/service.d/service_dhcpv6_server_bci.sh",
"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
};
#else
const char* SERVICE_CUSTOM_EVENTS[] = {
"lan-status|/etc/utopia/service.d/service_dhcpv6_server.sh",
Expand All @@ -64,8 +89,21 @@
};
#endif

#if defined(_ONESTACK_PRODUCT_REQ_)
static void init_service_custom_events(void)
{
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) {
SERVICE_CUSTOM_EVENTS = SERVICE_CUSTOM_EVENTS_BUSINESS;
} else {
SERVICE_CUSTOM_EVENTS = SERVICE_CUSTOM_EVENTS_RESIDENTIAL;
}
}
#endif

void srv_register(void) {
#if defined(_ONESTACK_PRODUCT_REQ_)
init_service_custom_events();
#endif
sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS);
}

Expand Down
50 changes: 48 additions & 2 deletions 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, 165 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 @@ -40,11 +40,16 @@
#endif
#include "srvmgr.h"
#include "secure_wrapper.h"
#ifdef _ONESTACK_PRODUCT_REQ_
#include <rdkb_feature_mode_gate.h>
#endif

#define SERVICE_NAME "routed"
#define SERVICE_DEFAULT_HANDLER "/etc/utopia/service.d/service_routed.sh"

#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if defined(_ONESTACK_PRODUCT_REQ_)
const char** SERVICE_CUSTOM_EVENTS = NULL;
Comment on lines +49 to +50
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.
#endif
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
const char* SERVICE_CUSTOM_EVENTS[] = {
Comment on lines +49 to 53
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.

OneStack introduces const char** SERVICE_CUSTOM_EVENTS = NULL; but this file also defines const char* SERVICE_CUSTOM_EVENTS[] under CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION. If both macros are enabled, this will not compile (symbol redefinition). Please restructure/guard so only one SERVICE_CUSTOM_EVENTS definition exists for any macro combination.

Copilot uses AI. Check for mistakes.
"wan-status|/etc/utopia/service.d/service_routed.sh",
"lan-status|/etc/utopia/service.d/service_routed.sh",
Expand All @@ -54,6 +59,33 @@
"staticroute-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
NULL
};
#elif defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS_RESIDENTIAL[] = {
"wan-status|/etc/utopia/service.d/service_routed.sh",
"lan-status|/etc/utopia/service.d/service_routed.sh",
"ipv6_nameserver|/etc/utopia/service.d/service_routed.sh",
"ipv6_prefix|/etc/utopia/service.d/service_routed.sh",
"ripd-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
"zebra-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
"staticroute-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
#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
Comment on lines 71 to 75
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.
};
const char* SERVICE_CUSTOM_EVENTS_BUSINESS[] = {
"wan-status|/etc/utopia/service.d/service_routed_bci.sh",
"lan-status|/etc/utopia/service.d/service_routed_bci.sh",
"dhcpv6_option_changed|/etc/utopia/service.d/service_routed_bci.sh|NULL|"TUPLE_FLAG_EVENT,
"ripd-restart|/etc/utopia/service.d/service_routed_bci.sh|NULL|"TUPLE_FLAG_EVENT,
"zebra-restart|/etc/utopia/service.d/service_routed_bci.sh|NULL|"TUPLE_FLAG_EVENT,
"staticroute-restart|/etc/utopia/service.d/service_routed_bci.sh|NULL|"TUPLE_FLAG_EVENT,
"ipv6_prefix_delegation|/etc/utopia/service.d/service_routed_bci.sh|NULL|"TUPLE_FLAG_EVENT,
NULL
};


#else
const char* SERVICE_CUSTOM_EVENTS[] = {
"wan-status|/etc/utopia/service.d/service_routed.sh",
Expand All @@ -72,7 +104,21 @@

#endif

#if defined(_ONESTACK_PRODUCT_REQ_)
static void init_service_custom_events(void)
{
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) {
SERVICE_CUSTOM_EVENTS = SERVICE_CUSTOM_EVENTS_BUSINESS;
} else {
SERVICE_CUSTOM_EVENTS = SERVICE_CUSTOM_EVENTS_RESIDENTIAL;
}
}
#endif

void srv_register(void) {
#if defined(_ONESTACK_PRODUCT_REQ_)
init_service_custom_events();
#endif
// not sure is the rm is necessary anymore
// system("rm -Rf /etc/iproute2/rt_tables");
DBG_PRINT("20_routing : %s Entry\n", __FUNCTION__);
Expand Down
3 changes: 3 additions & 0 deletions source/scripts/init/c_registration/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ endif
if ENABLE_HOTSPOT_SERVICE
15_hotspot_SOURCES = 15_hotspot.c
endif
if ONESTACK_PRODUCT_REQ
LDFLAGS += -lrdkb_feature_mode_gate
endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

Check failure on line 1 in source/scripts/init/service.d/service_dhcpv6_server_bci.sh

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/service.d/service_dhcpv6_server_bci.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 304 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/service.d/service_dhcpv6_server_bci.sh)
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
Expand Down Expand Up @@ -285,7 +285,9 @@
#----------------------------------------------------------------------------------
# Add other event entry points here
#----------------------------------------------------------------------------------

ipv6_prefix_delegation)
service_ipv6 restart
;;
# ipv6_nameserver|ipv6_dnssl)
# service_ipv6 dhcpv6s-restart
dhcpv6_option_changed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ sm_register_one_event() {
if [ "NULL" = "$SMR_EVENT" ] ; then
return 0
fi

# if this service has already registered for this event, then cancel the previous registration
# this is probably overkill since we likely already called sm_unregister, but better safe than sorry
sm_rm_event "${SMR_SERVICE}" "${SMR_EVENT_NAME}"
Expand Down
3 changes: 3 additions & 0 deletions source/scripts/init/service.d/service_routed_bci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

Check failure on line 1 in source/scripts/init/service.d/service_routed_bci.sh

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/service.d/service_routed_bci.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 102 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/service.d/service_routed.sh)

Check failure on line 1 in source/scripts/init/service.d/service_routed_bci.sh

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/service.d/service_routed_bci.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 102 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/service.d/service_routed_bci.sh)
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
Expand Down Expand Up @@ -80,6 +80,9 @@
staticroute-restart)
service_routed radv-restart
;;
ipv6_prefix_delegation)
service_routed radv-restart
;;
# ipv6_nameserver|ipv6_dnssl)
# service_routed radv-restart
# ;;
Expand Down
3 changes: 3 additions & 0 deletions 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
AM_LDFLAGS += -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 Down
Loading
Loading