netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Sun, 23 Sep 2007 17:05:27 +0200	[thread overview]
Message-ID: <46F680B7.4000907@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0709221757300.15712@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> Add the xt_time netfilter match
> 
> This is ipt_time from POM-ng enhanced by the following:
> 
>  * xtables/ipv6 support
>  * second granularity for daytime
>  * day-of-month support (for example "match on the 15th of each month")
>  * match against UTC or local timezone
> 
> Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>

Applied, thanks Jan.

Unfortunately gcc-4.2 seems to ignore casts from const -> non-const,
so the __net_timestamp call causes this warning:

net/netfilter/xt_time.c: In function 'xt_time_match':
net/netfilter/xt_time.c:170: warning: passing argument 1 of
'__net_timestamp' discards qualifiers from pointer target type

Not sure how we could shut this up, I definitely don't want to make
all match functions take non-const skb args. ip_queue has the same
warning.

> +	localtime_2(&current_time, stamp);
> +
> +	if (!(info->weekdays_match & (1 << current_time.weekday)))
> +		return false;

Shouldn't this do the same optimization as below?

> +
> +	/* Do not spend time computing monthday if all days match anyway */
> +	if (info->monthdays_match != XT_TIME_ALL_MONTHDAYS) {
> +		localtime_3(&current_time, stamp);
> +		if (!(info->monthdays_match & (1 << current_time.monthday)))
> +			return false;
> +	}
> +
> +	return true;
> +}

  reply	other threads:[~2007-09-23 15:14 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
2007-09-22 15:47       ` Jan Engelhardt
2007-09-22 15:58     ` Jan Engelhardt
2007-09-23 15:05       ` Patrick McHardy [this message]
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=46F680B7.4000907@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 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).