From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Changli Gao <xiaosuo@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: Checksum of an IPv6 UDP packet is mandatory
Date: Fri, 28 Jun 2013 19:10:20 +0200 [thread overview]
Message-ID: <20130628171020.GA18080@localhost> (raw)
In-Reply-To: <1372436119-61481-1-git-send-email-xiaosuo@gmail.com>
On Sat, Jun 29, 2013 at 12:15:19AM +0800, Changli Gao wrote:
> Checksum of an IPv6 UDP packet is mandatory.
There is some discussion on this:
http://tools.ietf.org/html/rfc6936
"The inability to use an IPv6 datagram with a zero UDP checksum has
been found to be a real problem for certain classes of application,
primarily tunnel applications."
> ---
> net/netfilter/nf_conntrack_proto_udp.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
> index 9d7721c..31dc854 100644
> --- a/net/netfilter/nf_conntrack_proto_udp.c
> +++ b/net/netfilter/nf_conntrack_proto_udp.c
> @@ -134,8 +134,15 @@ static int udp_error(struct net *net, struct nf_conn *tmpl, struct sk_buff *skb,
> }
>
> /* Packet with no checksum */
> - if (!hdr->check)
> + if (!hdr->check) {
> + if (pf == PF_INET6) {
> + if (LOG_INVALID(net, IPPROTO_UDP))
> + nf_log_packet(net, pf, 0, skb, NULL, NULL, NULL,
> + "nf_ct_udp: bad UDP checksum ");
> + return -NF_ACCEPT;
> + }
> return NF_ACCEPT;
> + }
>
> /* Checksum invalid? Ignore.
> * We skip checking packets on the outgoing path
> --
> 1.7.9.5
>
prev parent reply other threads:[~2013-06-28 17:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 16:15 [PATCH] netfilter: Checksum of an IPv6 UDP packet is mandatory Changli Gao
2013-06-28 17:10 ` Pablo Neira Ayuso [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=20130628171020.GA18080@localhost \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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).