netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RESEND] libxt_time: fix random --datestart skips
@ 2010-12-16 15:28 Florian Westphal
  2011-01-09 21:01 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2010-12-16 15:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

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>
---
 extensions/libxt_time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c
index 5462d93..b2e6ffa 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;
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][RESEND] libxt_time: fix random --datestart skips
  2010-12-16 15:28 [PATCH][RESEND] libxt_time: fix random --datestart skips Florian Westphal
@ 2011-01-09 21:01 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2011-01-09 21:01 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

On 16/12/10 16:28, Florian Westphal wrote:
> 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>

Applied, thanks Florian.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-09 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16 15:28 [PATCH][RESEND] libxt_time: fix random --datestart skips Florian Westphal
2011-01-09 21:01 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).