* [PATCH] netfilter: Checksum of an IPv6 UDP packet is mandatory
@ 2013-06-28 16:15 Changli Gao
2013-06-28 17:10 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Changli Gao @ 2013-06-28 16:15 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Changli Gao, netfilter-devel
Checksum of an IPv6 UDP packet is mandatory.
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netfilter: Checksum of an IPv6 UDP packet is mandatory
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
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-06-28 17:10 UTC (permalink / raw)
To: Changli Gao; +Cc: netfilter-devel
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-28 17:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.