fix(firewall): RDKB-64133: Restore #include <devicemode.h> and -ldevicemode inadvertently removed in PR #355#361
Merged
Conversation
Commit 620e270 in PR #355 (RDKB-64133) inadvertently removed the #include <devicemode.h> header and the corresponding -ldevicemode linker flag from Makefile.am under the _ONESTACK_PRODUCT_REQ_ guard. The isFeatureSupportedInCurrentMode() call added in the same PR depends on the devicemode library. Without this header the build fails for ONESTACK targets. Restore both the include and the Makefile.am linker entry.
Contributor
There was a problem hiding this comment.
Pull request overview
Restores ONESTACK build dependencies for the firewall component after they were inadvertently removed in PR #355, ensuring isFeatureSupportedInCurrentMode() usage links and compiles correctly on ONESTACK targets.
Changes:
- Re-add
-ldevicemodeunder theONESTACK_PRODUCT_REQconditional insource/firewall/Makefile.am. - Re-add
#include <devicemode.h>under_ONESTACK_PRODUCT_REQ_insource/firewall/firewall.c.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| source/firewall/Makefile.am | Restores ONESTACK-only linker dependency on libdevicemode to fix unresolved symbols at link time. |
| source/firewall/firewall.c | Restores ONESTACK-only header include needed for feature mode gating APIs/constants used by the firewall. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apattu200
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Commit 620e270 in PR #355 (
RDKB-64133: Allow restoreConfig in business devices) inadvertently removed two items required for ONESTACK builds:#include <devicemode.h>fromsource/firewall/firewall.cinside the#ifdef _ONESTACK_PRODUCT_REQ_guard-ldevicemodelinker flag fromsource/firewall/Makefile.amunder theONESTACK_PRODUCT_REQconditionalThe
isFeatureSupportedInCurrentMode(FEATURE_SAVE_RESTORE)call that was added in the same PR #355 depends on thedevicemodelibrary. Without the header and linker flag, ONESTACK target builds will fail with unresolved symbol / missing header errors.Root Cause
In commit 620e270, while refactoring the
_ONESTACK_PRODUCT_REQ_include block,<devicemode.h>was removed fromfirewall.cand-ldevicemodewas removed fromMakefile.am. This was not intentional — theisFeatureSupportedInCurrentMode()API is declared indevicemode.hand implemented inlibdevicemode.Fix
Restore both:
source/firewall/firewall.c#include <devicemode.h>inside#ifdef _ONESTACK_PRODUCT_REQ_blocksource/firewall/Makefile.amAM_LDFLAGS += -ldevicemodeunderif ONESTACK_PRODUCT_REQTest Procedure
devicemode.h: No such file or directoryorundefined reference to 'isFeatureSupportedInCurrentMode'errors.devicemode.his not included for CBR2 (guarded by_ONESTACK_PRODUCT_REQ_).FEATURE_SAVE_RESTOREenabled: verify thatPOST /restoreConfig.jstis allowed through the firewall upload attack filter.FEATURE_SAVE_RESTOREdisabled: verify thatPOST /restoreConfig.jstis not exempted (blocked by the upload attack filter as before)..pi,.sh,.py,multipart/form-data) continue to operate correctly on both ONESTACK and non-ONESTACK targets.Related