Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 674844 - net-firewall/nftables Use atomic firewall updates on modern kernels
Summary: net-firewall/nftables Use atomic firewall updates on modern kernels
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-08 02:02 UTC by Francisco Blas Izquierdo Riera
Modified: 2019-01-08 02:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to add atomic updates (nftables.patch,7.86 KB, patch)
2019-01-08 02:02 UTC, Francisco Blas Izquierdo Riera (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco Blas Izquierdo Riera (RETIRED) gentoo-dev 2019-01-08 02:02:51 UTC
Created attachment 560342 [details, diff]
Patch to add atomic updates

Since kernel version 3.18 nftables provides support for flush ruleset which allows atomic updates as those done by iptables-restore. It also simplifies significantly the way in which rule clears can be done.

Also kernel 3.14 and higher provide the inet table which allows filtering ipv4 and ipv6 packets at the same time.

Taking into account this I have rewritten from scratch the nftables.sh file to provide the needed features and have written a new init.d file based on the current one in iptables.sh (and adding any functionality missing on the previous nftables one).

I have also added an option to allow for "secure" shutdown of the nftables service. That is, ensuring the firewall won't just allow all traffic after stoping the service but instead will either block all packets or those coming from new connections.

The enhancements can be found on  https://github.com/gentoo/gentoo/pull/10772 or on the attached patch.