-
Notifications
You must be signed in to change notification settings - Fork 42
RDKB-63540: [XB10] RIPv2 enable and mode restriction for single build #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -95,6 +95,10 @@ static const char* const service_routed_component_id = "ccsp.routed"; | |||||||||||||||||||||||||||||||||
| #include <libnet.h> | ||||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||||||||||||||||||||||||||||||||||
| #include <rdkb_feature_mode_gate.h> | ||||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #define ZEBRA_PID_FILE "/var/zebra.pid" | ||||||||||||||||||||||||||||||||||
| #define RIPD_PID_FILE "/var/ripd.pid" | ||||||||||||||||||||||||||||||||||
| #define ZEBRA_CONF_FILE "/var/zebra.conf" | ||||||||||||||||||||||||||||||||||
|
|
@@ -136,7 +140,7 @@ struct serv_routed { | |||||||||||||||||||||||||||||||||
| bool wan_ready; | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #if defined (_CBR_PRODUCT_REQ_) || defined (_BWG_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) | ||||||||||||||||||||||||||||||||||
| #if defined (_CBR_PRODUCT_REQ_) || defined (_BWG_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined (_XB10_PRODUCT_REQ_) | ||||||||||||||||||||||||||||||||||
| #ifdef _BWG_PRODUCT_REQ_ | ||||||||||||||||||||||||||||||||||
| #define LOG_FILE "/rdklogs/logs/ArmConsolelog.txt.0" | ||||||||||||||||||||||||||||||||||
| #else | ||||||||||||||||||||||||||||||||||
|
|
@@ -2124,10 +2128,19 @@ STATIC int radv_restart(struct serv_routed *sr) | |||||||||||||||||||||||||||||||||
| return radv_start(sr); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||||||||||||||||||||||||||||||||||
| static BOOL IsRIPConflictingFeaturesEnabled(void) | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| // TODO: Add check to see if any conflicting feature of RIP | ||||||||||||||||||||||||||||||||||
| // like MAP-T are enabled | ||||||||||||||||||||||||||||||||||
| return FALSE; | ||||||||||||||||||||||||||||||||||
|
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; | |
| static bool IsRIPConflictingFeaturesEnabled(void) | |
| { | |
| // TODO: Add check to see if any conflicting feature of RIP | |
| // like MAP-T are enabled | |
| return false; |
Copilot
AI
Feb 13, 2026
There was a problem hiding this comment.
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).
| 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
AI
Feb 13, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).