From 7c48873a7d47fb2943422a748a657f2067e0b54d Mon Sep 17 00:00:00 2001 From: ZiMing Mo Date: Mon, 23 May 2022 01:59:04 +0800 Subject: [PATCH] firewall4: refresh fullcone patch --- ...rewall4-add-support-for-fullcone-nat.patch | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch b/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch index 78a2079819..9b11ee2dd6 100644 --- a/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch +++ b/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch @@ -35,7 +35,7 @@ Renew: ZiMing Mo 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 {% 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 @@ -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 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 "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 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 this.state.defaults = defs; }, -@@ -2041,10 +2072,15 @@ return { +@@ -2058,10 +2089,15 @@ return { zone.related_subnets = related_subnets; zone.related_physdevs = related_physdevs;