[OpenWrt-Devel] [PATCH 1/1] firewall3: add --contiguous to time-based rules where needed

Philip Prindeville philipp_subx at redfish-solutions.com
Thu May 7 10:27:22 EDT 2020


Should I open a PR or is this the correct way to get a review for firewall3?

Thanks


> On May 1, 2020, at 1:21 PM, Philip Prindeville <philipp at redfish-solutions.com> wrote:
> 
> From: Philip Prindeville <philipp at redfish-solutions.com>
> 
> If the start_time > stop_time on a rule, then the --contiguous arg
> should be included in the rule.
> 
> Signed-off-by: Philip Prindeville <philipp at redfish-solutions.com>
> ---
> iptables.c | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/iptables.c b/iptables.c
> index 559fe7defef3be85c4eb2934884caf549f932bc5..5c02e6e26c93468f4ef6a7f917069bb49985aad8 100644
> --- a/iptables.c
> +++ b/iptables.c
> @@ -1099,6 +1099,9 @@ fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct fw3_time *time)
> 		fw3_ipt_rule_addarg(r, false, "--timestop", buf);
> 	}
> 
> +	if (time->timestart && time->timestop && time->timestart > time->timestop)
> +		fw3_ipt_rule_addarg(r, false, "--contiguous", NULL);
> +
> 	if (time->monthdays & 0xFFFFFFFE)
> 	{
> 		for (i = 1, p = buf; i < 32; i++)



_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list