Skip to content

fix(net-filter): load policy files and clarify debug usage - #143

Merged
xu-lang merged 1 commit into
DKapture:mainfrom
yuKing123-king:fix/net-filter-policy-and-debug
Sep 14, 2026
Merged

xu-lang merged 1 commit into
DKapture:mainfrom
yuKing123-king:fix/net-filter-policy-and-debug

Conversation

@yuKing123-king

Copy link
Copy Markdown
Contributor

解决的问题

  • net-filter 之前没有真正读取 -p 指定的 policy 文件,导致配置文件路径参数不生效。
  • 程序内部还存在一条硬编码默认规则,容易干扰 policy 文件的实际效果验证。
  • --debug 的帮助说明不够明确,容易让人误以为可以写成 -d 9--debug 9

修改内容

  • filter/net-filter.cpp 中恢复 nf.load_rules(poli_path.c_str()),让 -p 指定的 policy 文件真正生效。
  • 移除了 main() 里那条硬编码的默认 TCP log 规则,避免覆盖或污染 policy 配置结果。
  • 调整了 --helpdebug 参数的说明,明确写出推荐用法 -d9 / --debug=9
  • docs/net-filter.md 中同步更新了 debug 参数说明。

@rwenz2004

Copy link
Copy Markdown

/review

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 95200cb)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@yuKing123-king
yuKing123-king force-pushed the fix/net-filter-policy-and-debug branch from 5f8041e to 562ca03 Compare September 14, 2026 02:56
Signed-off-by: Wang Yu <wangyu6@uniontech.com>
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 95200cb

1 similar comment
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 95200cb

@xu-lang
xu-lang merged commit 2a76bd0 into DKapture:main Sep 14, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants