RDKB-63624 Handle static ip for Firewall, OneToOneNAT and Static Routing#240
RDKB-63624 Handle static ip for Firewall, OneToOneNAT and Static Routing#240hpatel006c merged 3 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for handling static IP configuration in OneStack builds by introducing conditional logic based on device mode (business vs non-business). The changes ensure that static IP-related code paths are properly gated for OneStack products while maintaining backward compatibility with existing CISCO_CONFIG_TRUE_STATIC_IP builds.
Changes:
- Added runtime device mode checks for OneStack builds to differentiate between business and non-business scenarios
- Updated build configuration to link required OneStack libraries
- Modified static IP and NAT configuration logic to support OneStack's dual-mode operation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| source/firewall/firewall.c | Added conditional compilation blocks with runtime device mode checks to handle static IP configuration differently for OneStack business vs non-business modes |
| source/firewall/Makefile.am | Added linker flags for OneStack-specific libraries (devicemode, onestack_syscfg, onestack_log) when ONESTACK_PRODUCT_REQ is enabled |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| #ifdef CISCO_CONFIG_TRUE_STATIC_IP | ||
| #if defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
Inconsistent indentation. The nested '#ifdef' directive should align with the outer '#if' directive at the same column position, or use consistent indentation throughout the file for nested preprocessor directives. The current indentation with leading spaces makes the preprocessor directive structure unclear.
| isFWTS_enable = (0 == strcmp("1", firewall_true_static_ip_enable) ? 1 : 0); | ||
|
|
||
| #else | ||
| } |
There was a problem hiding this comment.
Trailing whitespace detected. Line ends with unnecessary whitespace characters that should be removed.
| } | |
| } |
| #ifdef CISCO_CONFIG_TRUE_STATIC_IP | ||
| #if defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(is_devicemode_business()) |
There was a problem hiding this comment.
Missing space after 'if' keyword. The code style in the surrounding context consistently uses a space between 'if' and the opening parenthesis (e.g., lines 2554, 2547, 2595). This should be 'if (is_devicemode_business())' for consistency.
| if(is_devicemode_business()) | |
| if (is_devicemode_business()) |
| #endif | ||
| #if !defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(!is_devicemode_business()) |
There was a problem hiding this comment.
Missing space after 'if' keyword. The code style in the surrounding context consistently uses a space between 'if' and the opening parenthesis. This should be 'if (!is_devicemode_business())' for consistency.
| #ifdef CISCO_CONFIG_TRUE_STATIC_IP | ||
| #if defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(is_devicemode_business()) |
There was a problem hiding this comment.
Missing space after 'if' keyword. The code style in the surrounding context consistently uses a space between 'if' and the opening parenthesis. This should be 'if (is_devicemode_business())' for consistency.
| #endif | ||
| #if !defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(!is_devicemode_business()) |
There was a problem hiding this comment.
Missing space after 'if' keyword. The code style in the surrounding context consistently uses a space between 'if' and the opening parenthesis. This should be 'if (!is_devicemode_business())' for consistency.
| } | ||
| #endif | ||
| #if !defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
Inconsistent indentation. The nested '#ifdef' directive should align with the outer '#if' directive at the same column position, or use consistent indentation throughout the file for nested preprocessor directives. The current indentation with leading spaces makes the preprocessor directive structure unclear.
| } | ||
| #endif | ||
| #if !defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
Inconsistent indentation. The nested '#ifdef' directive should align with the outer '#if' directive at the same column position, or use consistent indentation throughout the file for nested preprocessor directives. The current indentation with leading spaces makes the preprocessor directive structure unclear.
| isNatEnabled = atoi(nat_enabled); | ||
| #ifdef CISCO_CONFIG_TRUE_STATIC_IP | ||
| #if defined(CISCO_CONFIG_TRUE_STATIC_IP) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
Inconsistent indentation. The nested '#ifdef' directive should align with the outer '#if' directive at the same column position, or use consistent indentation throughout the file for nested preprocessor directives. The current indentation with leading spaces makes the preprocessor directive structure unclear.
…ing (#218) US: RDKB-63097: Subtask: RDKB-63624 Handle static ip for Firewall, OneToOneNAT and Static Routing Reason for change: Add changes to ensure that true static ip and OneToOneNAT cannot be enabled for non business scenarios and that the dml's are unblocked in code for OneStack case and only enabled in business scenarios. Test Procedure: Build with OneStack distro and test Risks: None 1. Is this a Bug or a User Story (US)?: US: RDKB-63097 [XB10] Handle static IPv4 configuration for business Partner ID. Subtask: RDKB-63624 2. If it is a User Story: • Gerrit topic or list of all dependent PRs across components (including meta-layer changes) been shared? :topic: https://gerrit.teamccp.com/#/c/947813/ rdkcentral/utopia#240
US: RDKB-63097: Subtask: RDKB-63624 Handle static ip for Firewall, OneToOneNAT and Static Routing
Reason for change: Add changes ensure that code is unblocked in OneStack case and only enabled as needed in business and non business scenarios as needed.
Test Procedure: Build with OneStack distro and test
Risks: None
• Gerrit topic or list of all dependent PRs across components (including meta-layer changes) been shared?:
topic: https://gerrit.teamccp.com/#/c/947813/
RDKB-63624 Handle static ip for Firewall, OneToOneNAT and Static Routing provisioning-and-management#218