From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH] netfilter: Fix compiler warning. Date: Thu, 10 Dec 2009 05:25:36 +0100 Message-ID: <4B207840.7080603@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: davem@davemloft.net, netdev@vger.kernel.org, Patrick McHardy , Netfilter Developers To: chavey@google.com Return-path: In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: netfilter-devel.vger.kernel.org Le 10/12/2009 02:25, chavey@google.com a =E9crit : > 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. >=20 > Signed-off-by: Laurent Chavey This is not the right fix IMHO. We want an unique timestamp for the whole netfilter matches, because se= veral 'time' rules could get 'interesting' effects. The 'const' attribute is a debugging aid, and the skb->tstamp 'write-on= ce' is a valid exception. Read again the comment in time_mt() : 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 =3D par->matchinfo; unsigned int packet_time; struct xtm current_time; s64 stamp; /* * We cannot use get_seconds() instead of __net_timestamp() her= e. * 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 =3D=3D 0) __net_timestamp((struct sk_buff *)skb);