firewall4: refresh fullcone patch

This commit is contained in:
ZiMing Mo 2022-05-23 01:59:04 +08:00
parent 2e6308611a
commit 7c48873a7d
No known key found for this signature in database
GPG Key ID: 1BED2E3A77AE5ECF

View File

@ -35,7 +35,7 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
table inet fw4
@@ -238,6 +239,10 @@ table inet fw4 {
{% for (let redirect in fw4.redirects("dstnat_"+zone.name)): %}
{% for (let redirect in fw4.redirects(`dstnat_${zone.name}`)): %}
{%+ include("redirect.uc", { fw4, redirect }) %}
{% endfor %}
+{% if (fw4.default_option("fullcone")): %}
@ -46,7 +46,7 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
{% endif %}
@@ -246,20 +251,24 @@ table inet fw4 {
{% for (let redirect in fw4.redirects("srcnat_"+zone.name)): %}
{% for (let redirect in fw4.redirects(`srcnat_${zone.name}`)): %}
{%+ include("redirect.uc", { fw4, redirect }) %}
{% endfor %}
-{% if (zone.masq): %}
@ -84,10 +84,10 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
@@ -1,3 +1,5 @@
+// /usr/share/ucode/fw4.uc
+
let fs = require("fs");
let uci = require("uci");
let ubus = require("ubus");
@@ -419,6 +421,25 @@ function nft_try_hw_offload(devices) {
const fs = require("fs");
const uci = require("uci");
const ubus = require("ubus");
@@ -428,6 +430,25 @@ function nft_try_hw_offload(devices) {
return (rc == 0);
}
@ -113,7 +113,7 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
return {
read_kernel_version: function() {
@@ -1382,6 +1403,7 @@ return {
@@ -1383,6 +1404,7 @@ return {
"dnat",
"snat",
"masquerade",
@ -121,7 +121,7 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
"accept",
"reject",
"drop"
@@ -1787,6 +1809,7 @@ return {
@@ -1802,6 +1824,7 @@ return {
}
let defs = this.parse_options(data, {
@ -129,7 +129,7 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
input: [ "policy", "drop" ],
output: [ "policy", "drop" ],
forward: [ "policy", "drop" ],
@@ -1819,6 +1842,14 @@ return {
@@ -1834,6 +1857,14 @@ return {
delete defs.syn_flood;
@ -144,7 +144,7 @@ Renew: ZiMing Mo <msylgj@immortalwrt.org>
this.state.defaults = defs;
},
@@ -2041,10 +2072,15 @@ return {
@@ -2058,10 +2089,15 @@ return {
zone.related_subnets = related_subnets;
zone.related_physdevs = related_physdevs;