Fix FORWARD-drop reply handling

This commit is contained in:
2026-04-17 12:10:11 +08:00
parent 479c416b2f
commit 87ee5283c8
6 changed files with 61 additions and 46 deletions

View File

@@ -5,6 +5,7 @@
- 启动时自动做环境自检。
- 仅管理本工具创建的 `MGMT:<UUID>` 规则。
- 支持 TCP / UDP / both支持 IPv4 / IPv6 / both。
-`FORWARD` 默认策略为 `DROP` 时也会补齐回程放行规则。
- 支持 `iptables-persistent` / `netfilter-persistent save` 持久化。
- 所有写操作通过 `flock` 串行化,降低多实例并发竞争风险。
- 附带单元测试与真实 iptables 集成测试。
@@ -73,7 +74,7 @@ sudo ./iptables-forward.sh
规则列表中的状态列含义:
- `✓`:该条规则对应的 PREROUTING / POSTROUTING / FORWARD 运行态规则都存在
- `✓`:该条规则对应的 PREROUTING / POSTROUTING / 双向 FORWARD 运行态规则都存在
- `!`:至少缺少一条运行态规则,或仅剩数据库记录
### 批处理模式
@@ -155,8 +156,8 @@ tests/run_all.sh --skip-integration
- `tests/test_common.sh`:输入校验
- `tests/test_storage.sh`:规则存储
- `tests/test_env_check.sh`:环境检查与修复
- `tests/test_rules_unit.sh`mock iptables 下的增删回滚与并发写保护
- `tests/test_integration.sh`:真实 iptables 生命周期 + 命名空间端到端 IPv4/IPv6 TCP 转发 + save/reload 持久化回放测试
- `tests/test_rules_unit.sh`mock iptables 下的增删回滚、双向 FORWARD 规则与并发写保护
- `tests/test_integration.sh`:真实 iptables 生命周期 + `FORWARD=DROP` 下的命名空间端到端 IPv4/IPv6 TCP 转发 + save/reload 持久化回放测试
`tests/test_integration.sh` 的执行策略: