From: Laurent Chavey <chavey@google.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
Patrick McHardy <kaber@trash.net>,
Netfilter Developers <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] netfilter: Fix compiler warning.
Date: Thu, 10 Dec 2009 09:50:43 -0800 [thread overview]
Message-ID: <97949e3e0912100950u51f627c9r515d9b69a02430f4@mail.gmail.com> (raw)
In-Reply-To: <4B207840.7080603@gmail.com>
On Wed, Dec 9, 2009 at 8:25 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le 10/12/2009 02:25, chavey@google.com a écrit :
>> Fix compiler warning "discards qualifiers from pointer target type".
>> The function prototype defines parameters as pointer to a constant.
>> Such parameters should not have their content modified in the
>> function.
>>
>> Signed-off-by: Laurent Chavey <chavey@google.com>
>
> This is not the right fix IMHO.
>
> We want an unique timestamp for the whole netfilter matches, because several 'time' rules
> could get 'interesting' effects.
>
> The 'const' attribute is a debugging aid, and the skb->tstamp 'write-once' is a valid exception.
>
> Read again the comment in time_mt() :
good point. I agree with the need for the exception, I would just
like it to be more explicit
in the code itself (like a turn off check around that particular
statement) so we do not have to
scrub thru the compiler output to filter out good / bad warning.
question:
why do we not force the timestamp in the skb before going thru the
chain ? it looks to me
that the check for (skb->tstamp.tv64 == 0) should be done once
>
> vi +163 net/netfilter/xt_time.c
>
> static bool
> time_mt(const struct sk_buff *skb, const struct xt_match_param *par)
> {
> const struct xt_time_info *info = par->matchinfo;
> unsigned int packet_time;
> struct xtm current_time;
> s64 stamp;
>
> /*
> * We cannot use get_seconds() instead of __net_timestamp() here.
> * Suppose you have two rules:
> * 1. match before 13:00
> * 2. match after 13:00
> * If you match against processing time (get_seconds) it
> * may happen that the same packet matches both rules if
> * it arrived at the right moment before 13:00.
> */
> if (skb->tstamp.tv64 == 0)
> __net_timestamp((struct sk_buff *)skb);
>
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-12-10 17:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <pvmhbrzboyb.fsf@chavey.mtv.corp.google.com>
2009-12-10 2:07 ` [PATCH] netfilter: Fix compiler warning David Miller
2009-12-10 4:25 ` Eric Dumazet
2009-12-10 11:26 ` Patrick McHardy
2009-12-10 17:50 ` Laurent Chavey [this message]
2009-12-10 18:53 ` Jan Engelhardt
2009-12-10 19:31 ` Eric Dumazet
2009-12-10 21:44 chavey
2009-12-10 22:06 ` Jan Engelhardt
2009-12-10 22:08 ` David Miller
2009-12-10 23:23 ` Jan Engelhardt
2009-12-10 23:44 ` Jan Engelhardt
2009-12-14 13:20 ` Patrick McHardy
2009-12-10 22:13 ` Andrew Morton
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=97949e3e0912100950u51f627c9r515d9b69a02430f4@mail.gmail.com \
--to=chavey@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--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).