From: Fengguang Wu <fengguang.wu@intel.com>
To: Patrick McHardy <kaber@trash.net>
Cc: kernel-janitors@vger.kernel.org,
Pablo Neira Ayuso <pablo@netfilter.org>,
linux-can@vger.kernel.org
Subject: Re: [can:master 239/293] net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning: passing argument 4 of 'NF_HOOK_THRESH' discards qualifiers from pointer target type
Date: Thu, 20 Sep 2012 15:34:33 +0800 [thread overview]
Message-ID: <20120920073433.GA1370@localhost> (raw)
In-Reply-To: <Pine.GSO.4.63.1209200902120.8409@stinky-local.trash.net>
On Thu, Sep 20, 2012 at 09:14:02AM +0200, Patrick McHardy wrote:
> On Tue, 11 Sep 2012, Patrick McHardy wrote:
>
> >On Fri, 7 Sep 2012, Fengguang Wu wrote:
> >
> >>Hi Patrick,
> >>
> >>FYI, there are new compile warnings show up in
> >>
> >>tree: git://gitorious.org/linux-can/linux-can-next master
> >>head: bbe660a7ddf32dfe80753c6722e141bf7e4bf5d8
> >>commit: 4cdd34084d539c758d00c5dc7bf95db2e4f2bc70 [239/293]
> >>netfilter: nf_conntrack_ipv6: improve fragmentation handling
> >>config: avr32-atngw100_defconfig (attached as .config)
> >>
> >>All error/warnings:
> >>
> >>net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c: In function
> >>'__ipv6_conntrack_in':
> >>net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning:
> >>passing argument 4 of 'NF_HOOK_THRESH' discards qualifiers from
> >>pointer target type
> >>net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning:
> >>passing argument 5 of 'NF_HOOK_THRESH' discards qualifiers from
> >>pointer target type
> >
> >Thanks, I'll look into this.
>
> It seems the cure for this is worse than the problem. The code
> currently casts the const struct net_device pointer to non-const
> for the NF_HOOK_THRES call. To avoid the cast we'd have to change
> all netfilter hooks to take a non-const pointer. The alternative
> would be to change the NF_HOOK functions to also take a const struct
> net_device pointer, but that would require the same cast to non-const
> for nf_queue, which uses dev_hold() and dev_put(), so this would
> effectively just move the warning to a different place.
>
> nf_queue is a quite special case, normally netfilter hooks shouln't
> be changing anything on the net_device, so I don't want to unconstify
> the arguments.
>
> The compiler actually shouldn't warn about this since its an explicit
> cast. I know some older versions of gcc did this, but there's no
> warning with current versions of gcc and the same casts are already
> present
> in other parts of IPv6 conntrack.
Yes, the avr32 builds are using an old gcc. Please ignore this
warning. I'll teach the build system to ignore this class of warning
on older gcc.
Thanks,
Fengguang
prev parent reply other threads:[~2012-09-20 7:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 23:19 [can:master 239/293] net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning: passing argument 4 of 'NF_HOOK_THRESH' discards qualifiers from pointer target type Fengguang Wu
2012-09-11 8:44 ` Patrick McHardy
2012-09-20 7:14 ` Patrick McHardy
2012-09-20 7:34 ` Fengguang Wu [this message]
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=20120920073433.GA1370@localhost \
--to=fengguang.wu@intel.com \
--cc=kaber@trash.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=pablo@netfilter.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