-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-62810,RDKB-62812:Initialize the default variables for Virtual Voice Interface creation #171
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 20 commits
0a3293d
18a8f27
9ec72c7
af6fb95
99fbc60
0ad0623
65c01cf
3caa07e
6440c35
241dcde
e3fcff2
62c3669
5893aed
72b32fb
0de112f
c3f88ae
b4546c7
52f8ccb
bda2d1f
165c493
8a068ed
9c80873
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 |
|---|---|---|
|
|
@@ -12546,6 +12546,16 @@ static int prepare_subtables(FILE *raw_fp, FILE *mangle_fp, FILE *nat_fp, FILE * | |
| updateAmenityNetworkRules(filter_fp,mangle_fp , AF_INET); | ||
| #endif | ||
| } | ||
| #if defined(SCXF10) | ||
| char cVoiceRule[64] = {0}; | ||
| sysevent_get(sysevent_fd, sysevent_token, "VoiceIpRule", cVoiceRule, sizeof(cVoiceRule)); | ||
| FIREWALL_DEBUG("%s: VoiceIpRule=%s\n" COMMA __FUNCTION__ COMMA cVoiceRule); | ||
| if (strlen(cVoiceRule) > 0) | ||
| { | ||
| fprintf(filter_fp,"%s\n", cVoiceRule); | ||
| FIREWALL_DEBUG("%s: Applied VoiceIpRule\n" COMMA __FUNCTION__); | ||
| } | ||
| #endif | ||
|
||
| //Add wan2self restrictions to other wan interfaces | ||
| //ping is allowed to cm and mta inferfaces regardless the firewall level | ||
| #if !defined(_HUB4_PRODUCT_REQ_) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1449,6 +1449,18 @@ STATIC void addInSysCfgdDB (char *key, char *value) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values( value,"IPv6PrimaryDhcpServerOptions" ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1462
to
+1468
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1463
to
+1472
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| } | |
| } |
Copilot
AI
Feb 7, 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 new nested if-statements here omit braces, unlike the surrounding convention in this function (each key match uses a braced block). Please add braces around the new conditions to avoid future dangling-statement mistakes and keep style consistent.
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| } | |
| } |
Copilot
AI
Feb 11, 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 newly added VoiceSupport syscfg mappings use nested if statements without braces, unlike the surrounding code which consistently wraps these blocks in {}. This can trigger -Wmisleading-indentation and makes future edits error-prone (dangling else). Please add braces and align formatting with the existing if ( 0 == strcmp ( key, ... ) ) { ... } pattern used above.
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.
The new VOICE_MTA_SUPPORT block uses nested single-line if statements without braces, unlike the surrounding code which consistently braces if bodies. This is brittle (easy to mis-edit and can lead to accidental mis-binding when lines are added). Please wrap these conditionals in braces (and consider using else if to make exclusivity explicit).
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| } | |
| } |
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.
This VOICE_MTA_SUPPORT mapping is added only in apply_system_defaults.c, but the build also has a PARTNER_DEFAULT_EXT path that compiles apply_system_defaults_helper.c (see source/scripts/init/src/apply_system_defaults/Makefile.am). That helper currently does not set these VoiceSupport_* syscfg defaults, so behavior will differ depending on build configuration. Please mirror these additions in apply_system_defaults_helper.c (and any other relevant apply_system_defaults variants) to keep defaults consistent.
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.
Test coverage: source/test/apply_system_defaults/apply_system_defaults_test.cpp exercises addInSysCfgdDB/updateSysCfgdDB, but there are no unit tests validating the new VoiceSupport_* key mappings. Since this logic is a set of string-to-syscfg mappings, please add tests (guarded with #ifdef VOICE_MTA_SUPPORT if needed) that verify the expected syscfg_set calls for the three new TR-181 keys.
Copilot
AI
Feb 7, 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.
Same concern as above: this change only affects apply_system_defaults.c, but PARTNER_DEFAULT_EXT builds use apply_system_defaults_syscfg.c + apply_system_defaults_helper.c instead. If SCXF10 (or any target needing these keys) uses PARTNER_DEFAULT_EXT, VoiceSupport_* updates won’t happen. Please replicate this mapping in the PARTNER_DEFAULT_EXT code path.
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.
Same maintainability concern as above: the new VOICE_MTA_SUPPORT updates in updateSysCfgdDB are unbraced single-line ifs. Please add braces for consistency with the rest of this function and to reduce the chance of future edits accidentally changing control flow.
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| } |
Outdated
Copilot
AI
Jan 20, 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.
Missing empty string validation before setting the value. The existing code pattern in this function consistently checks whether the string is not empty before calling set_syscfg_partner_values. For example, lines 3044 and 3059 check if the string's first character is not null terminator using conditions like "if(pridhcpoption[0]!='\0')". The new code checks if the pointer is not NULL but doesn't verify that the string is not empty, which could lead to setting empty values in the configuration.
| if(pVoiceSupportEnabled != NULL) | |
| if((pVoiceSupportEnabled != NULL) && (pVoiceSupportEnabled[0] != '\0')) |
Outdated
Copilot
AI
Jan 20, 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.
Unnecessary pointer nullification. Setting the local pointer to NULL after use (line 3107) is unnecessary and inconsistent with similar code patterns. The pointer is a local variable that goes out of scope at the end of the if block, so nullifying it serves no purpose. While some other code in this file does this (e.g., lines 3018, 3047), many newer patterns like lines 3150-3155 don't, and it's considered an anti-pattern as it provides no actual benefit for local variables with limited scope.
| pVoiceSupportEnabled = NULL; |
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.
The log message here says "Value is NULL", but this branch is also taken when the JSON value is an empty string ("""). Consider distinguishing between NULL vs empty (or changing the message to something like "missing/empty") so field debugging is accurate.
Copilot
AI
Jan 20, 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.
Missing else clause for error handling. The existing code pattern in this function consistently includes an else clause that prints an error message when the outer if condition fails (paramObjVal is NULL). For example, lines 3050-3053, 3065-3068, 3080-3083, and 3095-3098 all include an else clause with an APPLY_PRINT statement. The new code blocks should follow the same error handling pattern for consistency and debugging purposes.
Outdated
Copilot
AI
Jan 20, 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.
Unnecessary pointer nullification. Setting the local pointer to NULL after use (line 3122) is unnecessary and inconsistent with similar code patterns. The pointer is a local variable that goes out of scope at the end of the if block, so nullifying it serves no purpose. While some other code in this file does this (e.g., lines 3018, 3047), many newer patterns like lines 3150-3155 don't, and it's considered an anti-pattern as it provides no actual benefit for local variables with limited scope.
Outdated
Copilot
AI
Jan 20, 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.
Missing empty string validation before setting the value. The existing code pattern in this function consistently checks whether the string is not empty before calling set_syscfg_partner_values. For example, lines 3044 and 3059 check if the string's first character is not null terminator using conditions like "if(pridhcpoption[0]!='\0')". The new code checks if the pointer is not NULL but doesn't verify that the string is not empty, which could lead to setting empty values in the configuration.
Copilot
AI
Jan 20, 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.
Missing else clause for error handling. The existing code pattern in this function consistently includes an else clause that prints an error message when the outer if condition fails (paramObjVal is NULL). For example, lines 3050-3053, 3065-3068, 3080-3083, and 3095-3098 all include an else clause with an APPLY_PRINT statement. The new code blocks should follow the same error handling pattern for consistency and debugging purposes.
Outdated
Copilot
AI
Feb 11, 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.
Same issue for Mode: this sets VoiceSupport_Mode even when the JSON ActiveValue is an empty string. Please check for non-empty string before committing to syscfg to avoid persisting an effectively-unset value.
| if(pVoiceSupportMode != NULL) | |
| if((pVoiceSupportMode != NULL) && (*pVoiceSupportMode != '\0')) |
Outdated
Copilot
AI
Jan 20, 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.
Missing empty string validation before setting the value. The existing code pattern in this function consistently checks whether the string is not empty before calling set_syscfg_partner_values. For example, lines 3044 and 3059 check if the string's first character is not null terminator using conditions like "if(pridhcpoption[0]!='\0')". The new code checks if the pointer is not NULL but doesn't verify that the string is not empty, which could lead to setting empty values in the configuration.
Outdated
Copilot
AI
Jan 20, 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.
Unnecessary pointer nullification. Setting the local pointer to NULL after use (line 3137) is unnecessary and inconsistent with similar code patterns. The pointer is a local variable that goes out of scope at the end of the if block, so nullifying it serves no purpose. While some other code in this file does this (e.g., lines 3018, 3047), many newer patterns like lines 3150-3155 don't, and it's considered an anti-pattern as it provides no actual benefit for local variables with limited scope.
| pVoiceSupportMode = NULL; |
Copilot
AI
Feb 7, 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.
In apply_partnerId_default_values, the new VoiceSupport values are written to syscfg even when the JSON value is an empty string. Nearby parameters check for non-empty strings before applying defaults (e.g., StartupIPMode, DHCP options). Consider also verifying the cJSON item is a string and non-empty before calling set_syscfg_partner_values to avoid clobbering defaults with empty values.
| char *pVoiceSupportEnabled = NULL; | |
| pVoiceSupportEnabled = paramObjVal->valuestring; | |
| if(pVoiceSupportEnabled != NULL) | |
| { | |
| set_syscfg_partner_values(pVoiceSupportEnabled,"VoiceSupport_Enabled"); | |
| pVoiceSupportEnabled = NULL; | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportEnabled Value is NULL\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| char *pVoiceSupportIfaceName = NULL; | |
| pVoiceSupportIfaceName = paramObjVal->valuestring; | |
| if(pVoiceSupportIfaceName != NULL) | |
| { | |
| set_syscfg_partner_values(pVoiceSupportIfaceName,"VoiceSupport_IfaceName"); | |
| pVoiceSupportIfaceName = NULL; | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportIfaceName Value is NULL\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| char *pVoiceSupportMode = NULL; | |
| pVoiceSupportMode = paramObjVal->valuestring; | |
| if(pVoiceSupportMode != NULL) | |
| { | |
| set_syscfg_partner_values(pVoiceSupportMode,"VoiceSupport_Mode"); | |
| pVoiceSupportMode = NULL; | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportMode Value is NULL\n", __FUNCTION__ ); | |
| if(cJSON_IsString(paramObjVal) && (paramObjVal->valuestring != NULL) && (paramObjVal->valuestring[0] != '\0')) | |
| { | |
| set_syscfg_partner_values(paramObjVal->valuestring,"VoiceSupport_Enabled"); | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportEnabled Value is NULL or empty or not a string\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| if(cJSON_IsString(paramObjVal) && (paramObjVal->valuestring != NULL) && (paramObjVal->valuestring[0] != '\0')) | |
| { | |
| set_syscfg_partner_values(paramObjVal->valuestring,"VoiceSupport_IfaceName"); | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportIfaceName Value is NULL or empty or not a string\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| if(cJSON_IsString(paramObjVal) && (paramObjVal->valuestring != NULL) && (paramObjVal->valuestring[0] != '\0')) | |
| { | |
| set_syscfg_partner_values(paramObjVal->valuestring,"VoiceSupport_Mode"); | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportMode Value is NULL or empty or not a string\n", __FUNCTION__ ); |
Copilot
AI
Jan 20, 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.
Missing else clause for error handling. The existing code pattern in this function consistently includes an else clause that prints an error message when the outer if condition fails (paramObjVal is NULL). For example, lines 3050-3053, 3065-3068, 3080-3083, and 3095-3098 all include an else clause with an APPLY_PRINT statement. The new code blocks should follow the same error handling pattern for consistency and debugging purposes.
Copilot
AI
Feb 7, 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 indentation of the newly added VoiceSupport block is inconsistent with the surrounding code in this function (many adjacent statements are unindented or use a different tab depth). Please reformat this block to match the local indentation style to keep future edits safe and readable.
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.
VoiceIpRuleis read into a 64-byte buffer and then written verbatim into the iptables-restore file. 64 bytes is likely too small for a full iptables rule; truncation could produce an invalid/partial rule that breaks firewall restore. Please use a larger buffer consistent with nearby code (e.g.,MAX_QUERY) and/or detect truncation / checksysevent_get()return before applying.