<feed xmlns='http://www.w3.org/2005/Atom'>
<title>firewall4/tests/mocks, branch master</title>
<subtitle>OpenWrt nftables firewall</subtitle>
<id>https://git.openwrt.org/project/firewall4/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/firewall4/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/'/>
<updated>2022-11-02T15:24:20Z</updated>
<entry>
<title>config: drop input traffic by default</title>
<updated>2022-11-02T15:24:20Z</updated>
<author>
<name>Baptiste Jonglez</name>
</author>
<published>2022-11-02T15:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=6443ec7805295de07f6051662065a16b4a194f19'/>
<id>urn:sha1:6443ec7805295de07f6051662065a16b4a194f19</id>
<content type='text'>
This is necessary with firewall4 to avoid a hard-to-diagnose race
condition during boot, causing DNAT rules not to be taken into account
correctly.

The root cause is that, during boot, the ruleset is mostly empty, and
interface-related rules (including DNAT rules) are added incrementally.
If a packet hits the input chain before the DNAT rules are setup, it can
create buggy conntrack entries that will persist indefinitely.

This new default should be safe because firewall4 explicitly accepts
authorized traffic and rejects the rest.  Thus, in normal operations, the
default policy is not used.

Fixes: #10749
Ref: https://github.com/openwrt/openwrt/issues/10749
Signed-off-by: Baptiste Jonglez &lt;git@bitsofnetworks.org&gt;
</content>
</entry>
<entry>
<title>fw4: support automatic includes</title>
<updated>2022-08-12T12:35:58Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-08-11T11:48:14Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=a4484d4612931800583a7219271b63224491244c'/>
<id>urn:sha1:a4484d4612931800583a7219271b63224491244c</id>
<content type='text'>
Introduce a new directory tree /usr/share/nftables.d/ which may contain
partial nftables files being included into the rendered ruleset.

The include position is derived from the file path;

 - Files in .../nftables.d/table-pre/ and .../nftables.d/table-post/ are
   included before and after the `table inet fw4 { ... }` declaration
   respectively

 - Files in .../nftables.d/ruleset-pre/ and .../nftables.d/ruleset-post/
   are included before the first chain and after the last chain
   declaration within the fw4 table respectively

 - Files in .../nftables.d/chain-pre/${chain}/ and .../chain-post/${chain}/
   are included before the first and after the last rule within the mentioned
   chain of the fw4 table respectively

Automatic includes can be disabled by setting the `auto_includes` option to
`0` in the global defaults section.

Also adjust testcases accordingly.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>tests: add missing fs.stat) mock data for `nf_conntrack_dummy`</title>
<updated>2022-08-08T19:09:12Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-08-08T19:08:29Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=5a02f74ec3bcf34881e6b8b64f7c36303f732e00'/>
<id>urn:sha1:5a02f74ec3bcf34881e6b8b64f7c36303f732e00</id>
<content type='text'>
Fixes: 111a7f7 ("fw4: don't inherit zone family from ct helpers")
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>tests: change mocked wan interface type to PPPoE</title>
<updated>2022-02-12T19:36:46Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-02-12T12:16:24Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=281b1bcd99f4a65410ae0559da4f6f130a31d4a8'/>
<id>urn:sha1:281b1bcd99f4a65410ae0559da4f6f130a31d4a8</id>
<content type='text'>
Change the WAN interface type in the mock data to PPPoE. PPPoE interfaces
are special because their L3 device differs from the L2 one which becomes
important later for resolving hw offloaded flowtable devices.

Adjust the test cases accordingly.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>fw4: only stage reflection rules if all required addrs are known</title>
<updated>2022-02-10T18:52:00Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-02-10T18:52:00Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=1a94915b5d38c9f17b27481add5a0a62341da627'/>
<id>urn:sha1:1a94915b5d38c9f17b27481add5a0a62341da627</id>
<content type='text'>
Do not stage reflection rules if any of the internal, external or
rewrite IP addrs cannot be determined. Also emit a warning in this
case and extend the redirect test case to cover this.

Fixes: #5067
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>fw4: consolidate helper code</title>
<updated>2022-02-05T23:33:04Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-02-04T22:44:25Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=4d5af8b0196912ab21f1b288f73cafa2eb6a1345'/>
<id>urn:sha1:4d5af8b0196912ab21f1b288f73cafa2eb6a1345</id>
<content type='text'>
 - Move various local helper functions out of main.uc into the fw4 class
 - Rework settype reading to use nft JSON output as terse mode now works
 - Simplify testing flowtable enable conditions
 - Adjust testcases to changed flowtable logic

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>tests: update interface dump mock data</title>
<updated>2022-01-27T15:22:11Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-01-27T14:55:38Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=ca88fcdfd1d3adfff965a2547e9c417a2950df24'/>
<id>urn:sha1:ca88fcdfd1d3adfff965a2547e9c417a2950df24</id>
<content type='text'>
Reorder and extend ubus interface dump mock. Ensure that the lan interface
has two IPv4 and IPv6 addresses each to cover address selection logic in
various fw4 parts.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>tests: add test for unknown rule option</title>
<updated>2022-01-09T13:22:25Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2022-01-07T12:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=69a89d60cae16fe128a547ac27d2498938effbf9'/>
<id>urn:sha1:69a89d60cae16fe128a547ac27d2498938effbf9</id>
<content type='text'>
Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
Reviewed-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>tests: add test for deprecated rule option</title>
<updated>2022-01-09T13:22:20Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2022-01-07T12:54:36Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=47c5a5b225d9ced1ee40594b1a8ea850508d26a3'/>
<id>urn:sha1:47c5a5b225d9ced1ee40594b1a8ea850508d26a3</id>
<content type='text'>
Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
Reviewed-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>tests: add test for unknown defaults option</title>
<updated>2022-01-09T13:22:16Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2022-01-07T12:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=550df40ec76f81c0d355d3be6b36bcd98cf93097'/>
<id>urn:sha1:550df40ec76f81c0d355d3be6b36bcd98cf93097</id>
<content type='text'>
Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
Reviewed-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
</feed>
