Rename FILTER type to DROP for firewall rules#47
Merged
Conversation
Co-authored-by: arloor <[email protected]>
Co-authored-by: arloor <[email protected]>
Co-authored-by: arloor <[email protected]>
Copilot
AI
changed the title
[WIP] Add filter drop capability for firewall functionality
Add filter drop capability for firewall functionality
Feb 1, 2026
arloor
reviewed
Feb 1, 2026
nat-common/src/lib.rs
Outdated
| validate_port(*src_port)?; | ||
| validate_port(*dst_port)?; | ||
| } | ||
| NftCell::Filter { |
Contributor
Author
There was a problem hiding this comment.
已添加使用 ipnetwork 库进行完善的IP地址和版本检测。现在会验证:
- IP地址格式是否有效(支持CIDR表示法如192.168.1.0/24)
- 源IP/目标IP与指定的IP版本是否匹配
- 提供清晰的错误信息
相关提交:2d9fcbb
…P address checking Co-authored-by: arloor <[email protected]>
Co-authored-by: arloor <[email protected]>
Co-authored-by: arloor <[email protected]>
Copilot
AI
changed the title
Add filter drop capability for firewall functionality
Rename FILTER type to DROP for firewall rules
Feb 1, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Renames the
FILTERtype toDROPthroughout the codebase for improved clarity - the rules drop packets, not just filter them.Changes
Type system
NftCell::Filter→NftCell::Drop#[serde(rename = "filter")]→#[serde(rename = "drop")]DROPinstead ofFILTERin legacy formatbuild_filter_rule()→build_drop_rule()Configuration formats
TOML:
Legacy:
Documentation
All 26 tests pass. No functional changes - purely a rename for better semantics.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.asddddddddddddddddddddaasdasdasdasdasdasadasads.com/home/REDACTED/work/nftables-nat-rust/nftables-nat-rust/target/debug/deps/nat-b300e34d1d8236c3 /home/REDACTED/work/nftables-nat-rust/nftables-nat-rust/target/debug/deps/nat-b300e34d1d8236c3 on-0875dbaada7680f8.1qhs3iz173h75grwc39mo4jdt.1n6bwo1.rcgu.o on-0875dbaada7680f8.1uh98quklm2zop2af2izuidnv.1n6bwo1.rcgu.o on-0875dbaada7680f8.21pff0csrziyyqf0iaymmm21o.1n6bwo1.rcgu.o on-0875dbaada7680f8.2e4zyoeyn5k3qh2xhp9bd1b0o.1n6bwo1.rcgu.o on-0875dbaada7680f8.2k2q629vzf28iije18xi8sblq.1n6bwo1.rcgu.o aef1ad19fc6c.02f477uhwr2mtgy7i6tws4bnx.0it7s82.rcgu.o aef1ad19fc6c.0fod9pw7k2mo0rx9h901q9jdb.0it7s82.rcgu.o aef1ad19fc6c.0i3h51g1vu4j3y1zvlpprxjwx.0it7s82.rcgu.o aef1ad19fc6c.0lmdox9vcpeat7qawfzfpll1u.0it7s82.rcgu.o aef1ad19fc6c.0phtwasaqn0wh95lq5nytm3hz.0it7s82.rcgu.o aef1ad19fc6c.0t4q5zulti7m79vrc28udqars.0it7s82.rcgu.o aef1ad19fc6c.0w7yd9cvgx0wmyho0z7rj4yoz.0it7s82.rcgu.o aef1ad19fc6c.0xe1reobxpwvqwkimplav9p5x.0it7s82.rcgu.o aef1ad19fc6c.11khmfxj3mrhcmmaetyee80qd.0it7s82.rcgu.o aef1ad19fc6c.15phb5jinfct54m9tonje9z2t.0it7s82.rcgu.o aef1ad19fc6c.17cwtnsfhx97sbds598h0i9e2.0it7s82.rcgu.o aef1ad19fc6c.182i28oi2lo2e325od8cxbkpj.0it7s82.rcgu.o aef1ad19fc6c.18adkpdyavmrrmki21i9ktg0l.0it7s82.rcgu.o aef1ad19fc6c.1ahfj541jjpg34m6yi9iubfdz.0it7s82.rcgu.o(dns block)www.google.com/home/REDACTED/work/nftables-nat-rust/nftables-nat-rust/target/debug/deps/nat-b300e34d1d8236c3 /home/REDACTED/work/nftables-nat-rust/nftables-nat-rust/target/debug/deps/nat-b300e34d1d8236c3 on-0875dbaada7680f8.1qhs3iz173h75grwc39mo4jdt.1n6bwo1.rcgu.o on-0875dbaada7680f8.1uh98quklm2zop2af2izuidnv.1n6bwo1.rcgu.o on-0875dbaada7680f8.21pff0csrziyyqf0iaymmm21o.1n6bwo1.rcgu.o on-0875dbaada7680f8.2e4zyoeyn5k3qh2xhp9bd1b0o.1n6bwo1.rcgu.o on-0875dbaada7680f8.2k2q629vzf28iije18xi8sblq.1n6bwo1.rcgu.o aef1ad19fc6c.02f477uhwr2mtgy7i6tws4bnx.0it7s82.rcgu.o aef1ad19fc6c.0fod9pw7k2mo0rx9h901q9jdb.0it7s82.rcgu.o aef1ad19fc6c.0i3h51g1vu4j3y1zvlpprxjwx.0it7s82.rcgu.o aef1ad19fc6c.0lmdox9vcpeat7qawfzfpll1u.0it7s82.rcgu.o aef1ad19fc6c.0phtwasaqn0wh95lq5nytm3hz.0it7s82.rcgu.o aef1ad19fc6c.0t4q5zulti7m79vrc28udqars.0it7s82.rcgu.o aef1ad19fc6c.0w7yd9cvgx0wmyho0z7rj4yoz.0it7s82.rcgu.o aef1ad19fc6c.0xe1reobxpwvqwkimplav9p5x.0it7s82.rcgu.o aef1ad19fc6c.11khmfxj3mrhcmmaetyee80qd.0it7s82.rcgu.o aef1ad19fc6c.15phb5jinfct54m9tonje9z2t.0it7s82.rcgu.o aef1ad19fc6c.17cwtnsfhx97sbds598h0i9e2.0it7s82.rcgu.o aef1ad19fc6c.182i28oi2lo2e325od8cxbkpj.0it7s82.rcgu.o aef1ad19fc6c.18adkpdyavmrrmki21i9ktg0l.0it7s82.rcgu.o aef1ad19fc6c.1ahfj541jjpg34m6yi9iubfdz.0it7s82.rcgu.o(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.