-
Notifications
You must be signed in to change notification settings - Fork 42
RDKB-63098: [ONESTACK]-Handle IPv6 delegation for business vs residential Partner ID as part of single build #238
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 2 commits
c2e4e85
a8c6b12
31e5822
0443b75
d979af5
9280c3f
33c34ce
1243c22
2abf304
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 | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -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
|
||||||||
| * following copyright and licenses apply: | ||||||||
| * | ||||||||
| * Copyright 2015 RDK Management | ||||||||
|
|
@@ -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
|
||||||||
|
|
||||||||
| #if defined(_CBR_PRODUCT_REQ_) && !defined(_CBR2_PRODUCT_REQ_) | ||||||||
| const char* SERVICE_CUSTOM_EVENTS[] = { | ||||||||
|
Comment on lines
+45
to
50
|
||||||||
| "dhcpv6_option_changed|/usr/bin/service_ipv6", | ||||||||
|
|
@@ -47,11 +54,28 @@ | |||||||
| "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 | ||||||||
|
Comment on lines
45
to
60
|
||||||||
| }; | ||||||||
| #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 | ||||||||
|
||||||||
| NULL | |
| NULL |
Outdated
Copilot
AI
Feb 26, 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.
This array initializer is syntactically invalid: the final element combines a string literal and NULL without a separating comma, which will fail compilation. Split the last entry into a string element and a separate NULL terminator (and ensure the TUPLE_FLAG_EVENT concatenation remains part of the string literal).
| "dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server_bci.sh|NULL|"TUPLE_FLAG_EVENT,NULL | |
| "dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server_bci.sh|NULL|"TUPLE_FLAG_EVENT, | |
| NULL |
| 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
|
||||||||||
| * following copyright and licenses apply: | ||||||||||
| * | ||||||||||
| * Copyright 2015 RDK Management | ||||||||||
|
|
@@ -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
|
||||||||||
| #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
AI
Feb 27, 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.
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
AI
Mar 2, 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.
This introduces a duplicate definition of SERVICE_CUSTOM_EVENTS when both _ONESTACK_PRODUCT_REQ_ and CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION are defined (pointer + array with the same identifier), which will fail compilation. Fix by making the OneStack pointer declaration mutually exclusive with the other SERVICE_CUSTOM_EVENTS[] declarations (e.g., fold it into the same #if/#elif/#else chain), or rename the OneStack-selected pointer (e.g., SERVICE_CUSTOM_EVENTS_PTR) and pass that to sm_register().
Outdated
Copilot
AI
Feb 26, 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.
The routeunset-ula handler path contains a double slash (/usr/bin//service_routed). While it may resolve on many systems, it’s an easy source of inconsistency and can break path comparisons/tools. Use /usr/bin/service_routed.
Copilot
AI
Feb 27, 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.
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.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||
| ########################################################################## | ||||||||
|
Check failure on line 1 in source/scripts/init/service.d/service_registration_functions.sh
|
||||||||
| # If not stated otherwise in this file or this component's Licenses.txt | ||||||||
| # file the following copyright and licenses apply: | ||||||||
| # | ||||||||
|
|
@@ -306,7 +306,7 @@ | |||||||
| if [ "NULL" = "$SMR_EVENT" ] ; then | ||||||||
| return 0 | ||||||||
| fi | ||||||||
|
|
||||||||
| echo "[DEBUG] sm_rm_event ${SMR_SERVICE} ${SMR_EVENT_NAME}" | ||||||||
|
||||||||
| echo "[DEBUG] sm_rm_event ${SMR_SERVICE} ${SMR_EVENT_NAME}" | |
| ulog srvmgr status "[DEBUG] sm_rm_event ${SMR_SERVICE} ${SMR_EVENT_NAME}" |
Outdated
Copilot
AI
Feb 26, 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.
These debug echo statements are unconditional and will add noise to boot/service manager logs on all devices. Consider guarding them behind a debug flag/environment variable (or using an existing structured logger like ulog if that’s the convention for this repo).
| echo "[DHCPV6][DEBUG] Registering custom event: '$custom' for service '$SM_SERVICE'" | |
| ulog dhcpv6 debug "Registering custom event: '$custom' for service '$SM_SERVICE'" |
Outdated
Copilot
AI
Feb 27, 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.
Debug echo statements are being added to shell scripts. These should be removed or made conditional before production deployment to avoid cluttering logs and potentially exposing sensitive information.
| echo "[DHCPV6][DEBUG] Registering custom event: '$custom' for service '$SM_SERVICE'" |
Uh oh!
There was an error while loading. Please reload this page.