From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: xt_time 2007-09-22
Date: Sat, 22 Sep 2007 17:39:53 +0200 [thread overview]
Message-ID: <46F53749.5070303@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0709221734080.15712@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> On Sep 22 2007 17:19, Patrick McHardy wrote:
>
>> A thought just occured to me (a bit late, but better than never :) ..
>>
>> Can't we just convert the user-specified times/dates to unix time
>> and match on that without all these expensive calculations? At least
>> for pure time matching without days this should work fine ..
>>
>
> Pure time matching (--datestart, --datestop) already use unix timing.
>
Right, I missed that.
> Daytime (--timestart) ... I wonder how you'd model
> "from 12:00 to 13:00, each day" other than it is done now.
> Same for weekday.
>
You're right again, that doesn't seem to be possible.
> Leaves monthday matching, which could probably be done with some more
> static tables, but I'd have to dig up some old encyclopedia from 1972
> and see how they did it.
>
I guess that will be a very rarely used feature anyway, don't
bother.
>
>>> + localtime_3(¤t_time, stamp);
>>> +
>>> + if (!(info->monthdays_match & (1 << current_time.monthday)))
>>> + return false;
>>>
>>>
>> I'd add a flag or check whether weekdays_match/monthdays_match
>> equals ~0 before doing the localtime calculations.
>>
>
> Certainly.
>
>
Thanks.
next prev parent reply other threads:[~2007-09-22 15:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-22 11:26 xt_time 2007-09-22 Jan Engelhardt
2007-09-22 11:28 ` xt_time 2007-09-22 (iptables) Jan Engelhardt
2007-09-23 15:08 ` Patrick McHardy
2007-09-22 15:19 ` xt_time 2007-09-22 Patrick McHardy
2007-09-22 15:38 ` Jan Engelhardt
2007-09-22 15:39 ` Patrick McHardy [this message]
2007-09-22 15:47 ` Jan Engelhardt
2007-09-22 15:58 ` Jan Engelhardt
2007-09-23 15:05 ` Patrick McHardy
2007-09-23 15:32 ` Jan Engelhardt
2007-09-23 16:20 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46F53749.5070303@trash.net \
--to=kaber@trash.net \
--cc=jengelh@computergmbh.de \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.