Skip to content

RDKB-63540: [XB10] RIPv2 enable and mode restriction for single build#219

Open
nvenka781 wants to merge 2 commits intodevelopfrom
rip_onestack
Open

RDKB-63540: [XB10] RIPv2 enable and mode restriction for single build#219
nvenka781 wants to merge 2 commits intodevelopfrom
rip_onestack

Conversation

@nvenka781
Copy link
Contributor

RDKB-63540: [XB10] RIPv2 enable and mode restriction for single build

Reason for change:
Adding feature support check for RIPv2
Added stub check for conflicting features like MAP-T

Test Procedure: Build

Risks: Low

Signed-off-by: Nagalakshmi Venkataraman [email protected]

Reason for change:
Adding feature support check for RIPv2
Added stub check for conflicting features like MAP-T

Test Procedure: Build

Risks: Low

Signed-off-by: Nagalakshmi Venkataraman [email protected]
@nvenka781 nvenka781 requested review from a team as code owners February 13, 2026 07:40
Copilot AI review requested due to automatic review settings February 13, 2026 07:40
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 feature gating for RIPv2 on XB10 builds so RIP can be rejected when the current mode doesn’t support it, and introduces a stub for blocking RIP when conflicting features (e.g., MAP-T) are enabled.

Changes:

  • Include and link rdkb_feature_mode_gate for OneStack builds.
  • Extend existing RIP logging/flow guards to include _XB10_PRODUCT_REQ_.
  • Add runtime gating in rip_start() to reject RIP when FEATURE_RIPv2 isn’t supported (and a placeholder conflict check).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
source/service_routed/service_routed.c Adds OneStack RIPv2 support/mode gating and extends product guards to XB10.
source/service_routed/Makefile.am Links -lrdkb_feature_mode_gate when ONESTACK_PRODUCT_REQ is enabled and adjusts -lnet LDFLAGS handling.

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

Comment on lines +2193 to +2199
t2_event_d("RIP_NotSupported", 1);
return -1;
}
else if (IsRIPConflictingFeaturesEnabled())
{
DEG_PRINT("RIP enable rejected due to conflicting features\n");
t2_event_d("RIP_NotSupported", 1);
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

New RIPv2 feature/mode gating logic in rip_start() is currently untested by the existing service_routed gtests (which exercise rip_start(), but won't hit this branch unless the relevant product/onestack macros are enabled and isFeatureSupportedInCurrentMode() is mocked). Adding a unit test for the "unsupported mode" path would help prevent regressions (e.g., verifying rip-status updates and that routed startup behavior matches expectations).

Suggested change
t2_event_d("RIP_NotSupported", 1);
return -1;
}
else if (IsRIPConflictingFeaturesEnabled())
{
DEG_PRINT("RIP enable rejected due to conflicting features\n");
t2_event_d("RIP_NotSupported", 1);
t2_event_d("RIP_NotSupported", 1);
sysevent_set(sr->sefd, sr->setok, "rip-status", "error", 0);
return -1;
}
else if (IsRIPConflictingFeaturesEnabled())
{
DEG_PRINT("RIP enable rejected due to conflicting features\n");
t2_event_d("RIP_NotSupported", 1);
sysevent_set(sr->sefd, sr->setok, "rip-status", "error", 0);

Copilot uses AI. Check for mistakes.
Comment on lines +143 to 144
#if defined (_CBR_PRODUCT_REQ_) || defined (_BWG_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined (_XB10_PRODUCT_REQ_)
#ifdef _BWG_PRODUCT_REQ_
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Adding XB10_PRODUCT_REQ to this block enables IsFileExists() (which uses struct stat/stat()), but <sys/stat.h> is only included for _CBR/_BWG/_CBR2. XB10 builds may fail to compile with unknown 'struct stat' / implicit 'stat'. Include <sys/stat.h> when XB10_PRODUCT_REQ is defined (or include it unconditionally in the IsFileExists block).

Copilot uses AI. Check for mistakes.
Comment on lines 2188 to 2201
#if defined (_CBR_PRODUCT_REQ_) || defined (_BWG_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined (_XB10_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (!isFeatureSupportedInCurrentMode(FEATURE_RIPv2))
{
DEG_PRINT("RIP enable rejected, unsupported mode\n");
t2_event_d("RIP_NotSupported", 1);
return -1;
}
else if (IsRIPConflictingFeaturesEnabled())
{
DEG_PRINT("RIP enable rejected due to conflicting features\n");
t2_event_d("RIP_NotSupported", 1);
return -1;
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

On unsupported mode / conflicting features, rip_start() returns -1 after setting "rip-status" to "starting". This leaves rip-status stuck at "starting" and also causes serv_routed_start() to fail ("routed-status" becomes "error"), even though the intended outcome seems to be "don't start RIP" rather than "fail routed". Consider moving the feature/conflict gate before setting statuses/generating config, and either set an appropriate terminal rip-status (e.g., "error"/"not-supported") and return 0, or explicitly handle this case so routed can still start RA/routes/firewall.

Copilot uses AI. Check for mistakes.
Comment on lines +2132 to +2136
static BOOL IsRIPConflictingFeaturesEnabled(void)
{
// TODO: Add check to see if any conflicting feature of RIP
// like MAP-T are enabled
return FALSE;
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

IsRIPConflictingFeaturesEnabled() introduces the BOOL return type, but this file otherwise uses C99 bool (and BOOL is not declared anywhere in this translation unit). This can break builds depending on include order/toolchain. Prefer using bool (from <stdbool.h>) and return true/false, or include the header that defines BOOL within the same compile-time guard.

Suggested change
static BOOL IsRIPConflictingFeaturesEnabled(void)
{
// TODO: Add check to see if any conflicting feature of RIP
// like MAP-T are enabled
return FALSE;
static bool IsRIPConflictingFeaturesEnabled(void)
{
// TODO: Add check to see if any conflicting feature of RIP
// like MAP-T are enabled
return false;

Copilot uses AI. Check for mistakes.
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.

1 participant