Skip to content

fix(firewall): RDKB-64133: Restore #include <devicemode.h> and -ldevicemode inadvertently removed in PR #355#361

Merged
apattu200 merged 2 commits into
developfrom
fix/RDKB-64133-restore-devicemode-header
Jul 3, 2026
Merged

fix(firewall): RDKB-64133: Restore #include <devicemode.h> and -ldevicemode inadvertently removed in PR #355#361
apattu200 merged 2 commits into
developfrom
fix/RDKB-64133-restore-devicemode-header

Conversation

@aadhithan01

Copy link
Copy Markdown
Contributor

Problem

Commit 620e270 in PR #355 (RDKB-64133: Allow restoreConfig in business devices) inadvertently removed two items required for ONESTACK builds:

  1. #include <devicemode.h> from source/firewall/firewall.c inside the #ifdef _ONESTACK_PRODUCT_REQ_ guard
  2. -ldevicemode linker flag from source/firewall/Makefile.am under the ONESTACK_PRODUCT_REQ conditional

The isFeatureSupportedInCurrentMode(FEATURE_SAVE_RESTORE) call that was added in the same PR #355 depends on the devicemode library. 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 from firewall.c and -ldevicemode was removed from Makefile.am. This was not intentional — the isFeatureSupportedInCurrentMode() API is declared in devicemode.h and implemented in libdevicemode.

Fix

Restore both:

File Change
source/firewall/firewall.c Re-add #include <devicemode.h> inside #ifdef _ONESTACK_PRODUCT_REQ_ block
source/firewall/Makefile.am Re-add AM_LDFLAGS += -ldevicemode under if ONESTACK_PRODUCT_REQ

Test Procedure

  1. Build for ONESTACK target — confirm the build completes without devicemode.h: No such file or directory or undefined reference to 'isFeatureSupportedInCurrentMode' errors.
  2. Build for CBR2 target — confirm no regression; devicemode.h is not included for CBR2 (guarded by _ONESTACK_PRODUCT_REQ_).
  3. Runtime test on ONESTACK/business device (XB10 or equivalent):
    • With FEATURE_SAVE_RESTORE enabled: verify that POST /restoreConfig.jst is allowed through the firewall upload attack filter.
    • With FEATURE_SAVE_RESTORE disabled: verify that POST /restoreConfig.jst is not exempted (blocked by the upload attack filter as before).
  4. Regression: confirm all existing firewall upload attack filter rules (.pi, .sh, .py, multipart/form-data) continue to operate correctly on both ONESTACK and non-ONESTACK targets.

Related

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.
Companion change to the firewall.c fix: restore the -ldevicemode
linker flag removed by commit 620e270 (PR #355, RDKB-64133).
@aadhithan01 aadhithan01 requested review from a team as code owners July 3, 2026 10:10
Copilot AI review requested due to automatic review settings July 3, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -ldevicemode under the ONESTACK_PRODUCT_REQ conditional in source/firewall/Makefile.am.
  • Re-add #include <devicemode.h> under _ONESTACK_PRODUCT_REQ_ in source/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 apattu200 merged commit f3f2bdb into develop Jul 3, 2026
12 of 13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants