RDKB-63540: [XB10] RIPv2 enable and mode restriction for single build#219
RDKB-63540: [XB10] RIPv2 enable and mode restriction for single build#219
Conversation
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]
There was a problem hiding this comment.
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_gatefor OneStack builds. - Extend existing RIP logging/flow guards to include
_XB10_PRODUCT_REQ_. - Add runtime gating in
rip_start()to reject RIP whenFEATURE_RIPv2isn’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.
| 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); |
There was a problem hiding this comment.
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).
| 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); |
| #if defined (_CBR_PRODUCT_REQ_) || defined (_BWG_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined (_XB10_PRODUCT_REQ_) | ||
| #ifdef _BWG_PRODUCT_REQ_ |
There was a problem hiding this comment.
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).
| #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; | ||
| } |
There was a problem hiding this comment.
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.
| static BOOL IsRIPConflictingFeaturesEnabled(void) | ||
| { | ||
| // TODO: Add check to see if any conflicting feature of RIP | ||
| // like MAP-T are enabled | ||
| return FALSE; |
There was a problem hiding this comment.
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.
| 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; |
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]