From: Heiko Schlittermann <hs@schlittermann.de>
To: Krzysztof Oledzki <olenf@ans.pl>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: Patch for ipt_time (to enable start > stop / crossing midnight)
Date: Wed, 4 Jan 2006 17:44:55 +0100 [thread overview]
Message-ID: <20060104164455.GH15217@schlittermann.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0601041639400.19966@bizon.gios.gov.pl>
[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]
Hello Krzysztof & *,
Krzysztof Oledzki <olenf@ans.pl> (Mi 04 Jan 2006 16:47:43 CET):
>
> How about this (also attached) one? Untested, but should work.
> [NETFILTER] Support for timestart > timestop in ipt_time (eg. 21:00 - 15:00)
>
> Based on a patch from Heiko Schlittermann <hs@schlittermann.de>
My "compound return" looked shorter :) but I admit, that your's is
better readable. I don't know, which one is faster or if good gcc
optimimzes both the same way ... (I learned to save every bit ;-)
> - if ((packet_time < info->time_start) || (packet_time > info->time_stop))
> - return 0;
> + if (info->time_start < info->time_stop) {
> + if ((packet_time < info->time_start) || (packet_time > info->time_stop))
> + return 0;
> + } else {
> + if ((packet_time < info->time_start) && (packet_time > info->time_stop))
> + return 0;
> + }
But I'd like to see:
if (info->time_start < info->time_stop) {
if ((packet_time < info->time_start) || (packet_time >= info->time_stop))
return 0;
} else {
if ((packet_time < info->time_start) && (packet_time >= info->time_stop))
return 0;
}
To match --timestart 12:07 --timestop 13:10 really from 12:07:00 to 13:09:59.
Best regards from Dresden
Viele Grüße aus Dresden
Heiko Schlittermann
--
SCHLITTERMANN.de ---------------------------- internet & unix support -
Heiko Schlittermann HS12-RIPE -----------------------------------------
gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2 7E92 EE4E AC98 48D0 359B -
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-01-04 16:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-04 14:27 Patch for ipt_time (to enable start > stop / crossing midnight) Heiko Schlittermann
2006-01-04 15:47 ` Krzysztof Oledzki
2006-01-04 16:36 ` Brad Fisher
2006-01-04 17:09 ` Krzysztof Oledzki
2006-01-04 17:18 ` Brad Fisher
2006-01-04 16:44 ` Heiko Schlittermann [this message]
2006-01-04 16:58 ` Krzysztof Oledzki
2006-01-05 9:41 ` Heiko Schlittermann
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=20060104164455.GH15217@schlittermann.de \
--to=hs@schlittermann.de \
--cc=netfilter-devel@lists.netfilter.org \
--cc=olenf@ans.pl \
/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.