summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorFlorian Westphal <fwestphal@astaro.com>2011-01-09 22:00:31 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2011-01-09 22:00:31 +0100
commit8ad33a34a34ba2bcd360352ad3b7772916832702 (patch)
tree8544af1a383997417e3ded10f0fe22e0db0a65fb /extensions
parent63ef52ac6bf8d555779456166009bd2f6b0a1081 (diff)
libxt_time: fix random --datestart skips
Frank Lichtenheld points out that -m time --datestart ... sometimes messes up --datestart: $ iptables -A INPUT -m time --datestart 2010-11-24T16:50:00 -j ACCEPT $ iptables-save | grep 11 -A INPUT -m time --datestart 2010-11-24T16:50:00 -j ACCEPT $ iptables-save | iptables-restore $ iptables-save | grep 11 -A INPUT -m time --datestart 2010-11-24T15:50:00 -j ACCEPT --datestart moved by one hour. As the --timestart option does not care about DST, always set dst=0 when parsing --starttime input. Reported-by: Frank Lichtenheld <flichtenheld@astaro.com> Signed-off-by: Florian Westphal <fwestphal@astaro.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/libxt_time.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c
index 5462d930..b2e6ffa6 100644
--- a/extensions/libxt_time.c
+++ b/extensions/libxt_time.c
@@ -139,6 +139,7 @@ static time_t time_parse_date(const char *s, bool end)
tm.tm_hour = hour;
tm.tm_min = minute;
tm.tm_sec = second;
+ tm.tm_isdst = 0;
ret = mktime(&tm);
if (ret >= 0)
return ret;