[PATCH] fw3: rules: fix parsing of multiple weekdays

Christopher Ng facboy at gmail.com
Wed Sep 23 18:08:36 EDT 2020


fw3 was not parsing the 'weekdays' option of rules correctly, it would
only put the first day listed into the iptables --weekdays option.

Signed-off-by: Christopher Ng <facboy at gmail.com>
---
 iptables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptables.c b/iptables.c
index e7e8b59..9e8fa74 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1208,7 +1208,7 @@ fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct fw3_time *time)
 					rem--;
 				}
 
-				p += snprintf(p, rem, "%u", i);
+				len = snprintf(p, rem, "%u", i);
 
 				if (len < 0 || len >= rem)
 					break;
-- 
2.17.1




More information about the openwrt-devel mailing list