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
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,6 @@ AC_CONFIG_FILES(

AM_CONDITIONAL([PLATFORM_PUMA7_ENABLED], [test $PLATFORM_PUMA7_ENABLED = yes])
AM_CONDITIONAL([FEATURE_RDKB_WAN_MANAGER], [test $FEATURE_RDKB_WAN_MANAGER = yes])
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.

This adds an Automake conditional for ONESTACK_PRODUCT_REQ, but it is not wired to any AC_ARG_ENABLE/AC_ARG_WITH or AC_DEFINE that would propagate a corresponding C macro (e.g., _ONESTACK_PRODUCT_REQ_) into config.h/compile flags. If this repo is expected to control the feature via configure, add a proper AC_ARG_ENABLE (or similar) and an AC_DEFINE so the C sources and all dependent components can reliably compile the intended code paths.

Suggested change
AM_CONDITIONAL([FEATURE_RDKB_WAN_MANAGER], [test $FEATURE_RDKB_WAN_MANAGER = yes])
AM_CONDITIONAL([FEATURE_RDKB_WAN_MANAGER], [test $FEATURE_RDKB_WAN_MANAGER = yes])
ONESTACK_PRODUCT_REQ=false
AC_ARG_ENABLE([onestack_product_req],
AS_HELP_STRING([--enable-onestack_product_req],[enable OneStack product requirements support]),
[
case "${enableval}" in
yes)
ONESTACK_PRODUCT_REQ=true
AC_DEFINE([_ONESTACK_PRODUCT_REQ_],[1],
[Enable OneStack product requirements support])
;;
no)
ONESTACK_PRODUCT_REQ=false
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-onestack_product_req])
;;
esac
],
[ONESTACK_PRODUCT_REQ=false])

Copilot uses AI. Check for mistakes.
AM_CONDITIONAL([ONESTACK_PRODUCT_REQ], [test "x$ONESTACK_PRODUCT_REQ" = "xtrue"])
AC_OUTPUT

3 changes: 3 additions & 0 deletions source/CMAgentSsp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ endif
if CORE_NET_LIB_FEATURE_SUPPORT
CcspCMAgentSsp_LDFLAGS += -lnet
endif
if ONESTACK_PRODUCT_REQ
CcspCMAgentSsp_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
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_PRODUCT_REQ_ is used as the C preprocessor feature flag throughout the code, but the build system change introduces an Automake conditional named ONESTACK_PRODUCT_REQ and only adds link libraries here. As-is, enabling the conditional won’t define _ONESTACK_PRODUCT_REQ_, so the new code paths (and header changes guarded by _ONESTACK_PRODUCT_REQ_) won’t compile in as intended. Add a consistent compile-time definition (e.g., CcspCMAgentSsp_CPPFLAGS += -D_ONESTACK_PRODUCT_REQ_ under this conditional, or switch the C guards to match the defined macro).

Suggested change
CcspCMAgentSsp_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
CcspCMAgentSsp_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate
CcspCMAgentSsp_CPPFLAGS += -D_ONESTACK_PRODUCT_REQ_

Copilot uses AI. Check for mistakes.
endif
4 changes: 2 additions & 2 deletions source/CMAgentSsp/gw_prov_abstraction.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in source/CMAgentSsp/gw_prov_abstraction.h

View workflow job for this annotation

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

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/CMAgentSsp/gw_prov_abstraction.h' (Match: rdkb/components/opensource/ccsp/GwProvApp/rdkb/components/opensource/ccsp/GwProvApp/1, 667 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/GwProvApp/+archive/RDKB-TEST-RELEASE-1.tar.gz, file: source/include/gw_prov_abstraction.h)
*
* Copyright 2015 RDK Management
*
Expand Down Expand Up @@ -205,7 +205,7 @@
typedef void (*fpDocsisRATransInterval)(unsigned short);
#endif
typedef void (*fpGW_Tr069PaSubTLVParse)(unsigned char type, unsigned short length, const unsigned char *value);
#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
typedef void (*fpGW_SetTopologyMode)(unsigned char type, unsigned short length, const unsigned char *value);
#endif

Expand All @@ -227,7 +227,7 @@
fpDocsisRATransInterval pDocsis_GetRATransInterval;
#endif
fpGW_Tr069PaSubTLVParse pGW_Tr069PaSubTLVParse;
#if defined (CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
fpGW_SetTopologyMode pGW_SetTopologyMode;
#endif
Comment on lines 208 to 232
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.

This header now conditionally changes the appCallBack struct layout when _ONESTACK_PRODUCT_REQ_ is defined. Since CcspCMAgentSsp links against an external -lgwprovappabs library (where SME_CreateEventHandler likely consumes appCallBack), any mismatch in whether _ONESTACK_PRODUCT_REQ_ is defined between the executable and that library can cause ABI/layout corruption at runtime. Ensure the same macro is defined consistently for all compilation units that include this header (or avoid changing the struct layout via conditional compilation).

Copilot uses AI. Check for mistakes.
}appCallBack;
Expand Down
35 changes: 30 additions & 5 deletions source/CMAgentSsp/gw_prov_sm.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in source/CMAgentSsp/gw_prov_sm.c

View workflow job for this annotation

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

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/CMAgentSsp/gw_prov_sm.c' (Match: rdkb/components/opensource/ccsp/GwProvApp/rdkb/components/opensource/ccsp/GwProvApp/1910, 3917 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/GwProvApp/+archive/rdk-dev-1910.tar.gz, file: source/gw_prov_sm.c)

Check failure on line 3 in source/CMAgentSsp/gw_prov_sm.c

View workflow job for this annotation

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

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/CMAgentSsp/gw_prov_sm.c' (Match: rdkb/components/opensource/ccsp/GwProvApp/rdkb/components/opensource/ccsp/GwProvApp/1, 3917 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/GwProvApp/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/gw_prov_sm.c)

Check failure on line 3 in source/CMAgentSsp/gw_prov_sm.c

View workflow job for this annotation

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

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/CMAgentSsp/gw_prov_sm.c' (Match: rdkb/components/opensource/ccsp/GwProvApp/rdkb/components/opensource/ccsp/GwProvApp/2102, 3917 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/GwProvApp/+archive/rdk-dev-2102.tar.gz, file: source/gw_prov_sm.c)
*
* Copyright 2015 RDK Management
*
Expand Down Expand Up @@ -85,6 +85,9 @@
#include "rdk_debug.h"
#endif

#ifdef _ONESTACK_PRODUCT_REQ_
#include <rdkb_feature_mode_gate.h>
#endif
#include <mqueue.h>
//core net lib
#include <stdint.h>
Expand Down Expand Up @@ -329,7 +332,7 @@
static void check_lan_wan_ready();
//static TlvParseCallbackStatus_e gotEnableType(unsigned char type, unsigned short length, const unsigned char *value);

#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
static TlvParseCallbackStatusExtIf_e GW_setTopologyMode(unsigned char type, unsigned short length, const unsigned char *value);
#endif

Expand Down Expand Up @@ -1016,9 +1019,16 @@
#endif
#endif

#ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
static TlvParseCallbackStatusExtIf_e GW_setTopologyMode(unsigned char type, unsigned short length, const unsigned char *value)
{
#ifdef _ONESTACK_PRODUCT_REQ_
if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
{
/* PD feature disabled — ignore TLV */
return TLV_PARSE_CALLBACK_OK_EXTIF;
}
Comment on lines +1025 to +1030
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

When _ONESTACK_PRODUCT_REQ_ is enabled, this code introduces references to isFeatureSupportedInCurrentMode() and FEATURE_IPV6_DELEGATION, but there is no declaration/definition visible in this repository or included headers in this file. Please include the proper header (or add an extern prototype / enum definition) under _ONESTACK_PRODUCT_REQ_ so OneStack builds don’t fail with an implicit declaration / undefined identifier.

Copilot uses AI. Check for mistakes.
#endif
unsigned char tpMode = *value;
TlvParseCallbackStatusExtIf_e st = TLV_PARSE_CALLBACK_OK_EXTIF;

Expand Down Expand Up @@ -2162,8 +2172,13 @@
{
CcspTraceError(("Removed file"));
}
#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
{
v_secure_system("sysevent set dhcpv6_client-stop");
}
#endif
}
Comment on lines +2175 to 2183
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Preprocessor directives in this block are indented inside the function body, which is inconsistent with most other #if/#endif usage in this file and makes the conditional structure harder to read/maintain. Consider left-aligning the #if/#endif to column 0 (and keeping the runtime if indented) to match surrounding style.

Suggested change
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
#endif
{
v_secure_system("sysevent set dhcpv6_client-stop");
}
#endif
}
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION))
#endif
{
v_secure_system("sysevent set dhcpv6_client-stop");
}
#endif
}

Copilot uses AI. Check for mistakes.

Expand Down Expand Up @@ -2545,8 +2560,13 @@
#else
if (eRouterMode != DOCESAFE_ENABLE_DISABLE_extIf /*&& bridge_mode == 0*/) // mipieper - pseduo bridge support
{
#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
{
sysevent_set(sysevent_fd_gs, sysevent_token_gs, "dhcpv6_client-start", "", 0);
}
#endif
}
if (!logged_docsis_reg_complete_uptime)
Expand Down Expand Up @@ -3898,9 +3918,14 @@
obj->pDocsis_GetRATransInterval = (fpDocsisRATransInterval)docsis_GetRATransInterval_callback;
#endif
obj->pGW_Tr069PaSubTLVParse = GW_Tr069PaSubTLVParse;
#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
{
void* pGW_setTopologyMode = GW_setTopologyMode;
obj->pGW_SetTopologyMode = (fpGW_SetTopologyMode)pGW_setTopologyMode;
}
Comment on lines +3921 to +3928
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

RegisterDocsisCallback() allocates appCallBack with malloc() and does not zero-initialize it. With the new runtime gating, when IPv6 delegation is not supported pGW_SetTopologyMode is left uninitialized (garbage) instead of being set to NULL, which can lead to crashes if the state machine reads/calls it. Please ensure the struct is zeroed (e.g., calloc/memset) or explicitly set obj->pGW_SetTopologyMode = NULL in the non-supported path.

Copilot uses AI. Check for mistakes.
Comment on lines +3921 to +3928
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.

When _ONESTACK_PRODUCT_REQ_ is defined but FEATURE_IPV6_DELEGATION is not supported, this block skips assigning obj->pGW_SetTopologyMode. Since obj is allocated with malloc (not zeroed), pGW_SetTopologyMode may contain an indeterminate value, which can lead to a crash/UB if the callback is invoked. Initialize the struct (e.g., zero-initialize or explicitly set pGW_SetTopologyMode = NULL in the non-supported path).

Copilot uses AI. Check for mistakes.
#endif
#if defined (WAN_FAILOVER_SUPPORTED)
if(RemoveIfFileExists(DOCSISLINKDOWN_TESTFILE)==0)// file is removed then link up during crash
Expand Down
Loading