[PR #5621] [MERGED] [client] Make raw table initialization non-fatal in firewall managers #26295

Open
opened 2026-08-05 07:07:09 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5621
Author: @lixmal
Created: 3/18/2026
Status: Merged
Merged: 3/19/2026
Merged by: @lixmal

Base: mainHead: fix-raw-table-init-fatal


📝 Commits (3)

  • f9242be Make raw table initialization non-fatal in firewall managers
  • 891903e Remove rawSupported guard from cleanupNoTrackChain to fix crash recovery
  • dedaf82 Treat ChainExists error as non-fatal when raw table was never initialized

📊 Changes

2 files changed (+15 additions, -5 deletions)

View changed files

📝 client/firewall/iptables/manager_linux.go (+14 -4)
📝 client/firewall/nftables/manager_linux.go (+1 -1)

📄 Description

Describe your changes

  • Make iptables/nftables raw table (notrack chain) initialization non-fatal during firewall Init()
  • Systems without iptable_raw or raw priority support now log a warning instead of failing the entire firewall manager
  • Add rawSupported guard to iptables so SetupEBPFProxyNoTrack and cleanup are skipped when raw is unavailable

The raw table is only used for eBPF proxy notrack rules, not core firewall functionality. The engine already handles SetupEBPFProxyNoTrack errors as non-fatal warnings, so blocking init on it was unnecessarily strict.

Fixes #5551

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (internal error handling change, no user-facing behavior difference)

Summary by CodeRabbit

  • Bug Fixes

    • Firewall initialization no longer fails if notrack chain setup is unavailable; a warning is logged and core firewall functionality continues.
  • Behavior Change

    • The system now detects raw-table notrack support; features that require raw notrack are skipped and return an error when unsupported, preventing unsafe operations.
    • Cleanup and setup flows now respect the detected support state to avoid spurious errors.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5621 **Author:** [@lixmal](https://github.com/lixmal) **Created:** 3/18/2026 **Status:** ✅ Merged **Merged:** 3/19/2026 **Merged by:** [@lixmal](https://github.com/lixmal) **Base:** `main` ← **Head:** `fix-raw-table-init-fatal` --- ### 📝 Commits (3) - [`f9242be`](https://github.com/netbirdio/netbird/commit/f9242beabf18c973177b446153e1658f374438bf) Make raw table initialization non-fatal in firewall managers - [`891903e`](https://github.com/netbirdio/netbird/commit/891903eeeba7c597fa7cbe10c8c266c75a466df9) Remove rawSupported guard from cleanupNoTrackChain to fix crash recovery - [`dedaf82`](https://github.com/netbirdio/netbird/commit/dedaf827398898a421194cfd3e63a0e50127fe94) Treat ChainExists error as non-fatal when raw table was never initialized ### 📊 Changes **2 files changed** (+15 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `client/firewall/iptables/manager_linux.go` (+14 -4) 📝 `client/firewall/nftables/manager_linux.go` (+1 -1) </details> ### 📄 Description ## Describe your changes - Make iptables/nftables raw table (notrack chain) initialization non-fatal during firewall `Init()` - Systems without `iptable_raw` or raw priority support now log a warning instead of failing the entire firewall manager - Add `rawSupported` guard to iptables so `SetupEBPFProxyNoTrack` and cleanup are skipped when raw is unavailable The raw table is only used for eBPF proxy notrack rules, not core firewall functionality. The engine already handles `SetupEBPFProxyNoTrack` errors as non-fatal warnings, so blocking init on it was unnecessarily strict. ## Issue ticket number and link Fixes #5551 ## Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (internal error handling change, no user-facing behavior difference) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Firewall initialization no longer fails if notrack chain setup is unavailable; a warning is logged and core firewall functionality continues. * **Behavior Change** * The system now detects raw-table notrack support; features that require raw notrack are skipped and return an error when unsupported, preventing unsafe operations. * Cleanup and setup flows now respect the detected support state to avoid spurious errors. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:07:09 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#26295