* [PATCH 1/1] ipv6: fix header length calculation in ip6_append_data()
@ 2013-01-16 22:47 Romain KUNTZ
2013-01-17 8:37 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Romain KUNTZ @ 2013-01-16 22:47 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: yoshfuji@linux-ipv6.org Hideaki, davem@davemloft.net,
Steffen Klassert, linux-kernel@vger.kernel.org, Romain KUNTZ
Commit 299b0767 (ipv6: Fix IPsec slowpath fragmentation problem)
has introduced a error in the header length calculation that
provokes corrupted packets when non-fragmentable extensions
headers (Destination Option or Routing Header Type 2) are used.
rt->rt6i_nfheader_len is the length of the non-fragmentable
extension header, and it should be substracted to
rt->dst.header_len, and not to exthdrlen, as it was done before
commit 299b0767.
This patch reverts to the original and correct behavior. It has
been successfully tested with and without IPsec on packets
that include non-fragmentable extensions headers.
Signed-off-by: Romain Kuntz <r.kuntz@ipflavors.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/ipv6/ip6_output.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 5552d13..0c7c03d 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1213,10 +1213,10 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
if (dst_allfrag(rt->dst.path))
cork->flags |= IPCORK_ALLFRAG;
cork->length = 0;
- exthdrlen = (opt ? opt->opt_flen : 0) - rt->rt6i_nfheader_len;
+ exthdrlen = (opt ? opt->opt_flen : 0);
length += exthdrlen;
transhdrlen += exthdrlen;
- dst_exthdrlen = rt->dst.header_len;
+ dst_exthdrlen = rt->dst.header_len - rt->rt6i_nfheader_len;
} else {
rt = (struct rt6_info *)cork->dst;
fl6 = &inet->cork.fl.u.ip6;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] ipv6: fix header length calculation in ip6_append_data()
2013-01-16 22:47 [PATCH 1/1] ipv6: fix header length calculation in ip6_append_data() Romain KUNTZ
@ 2013-01-17 8:37 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-17 8:37 UTC (permalink / raw)
To: r.kuntz; +Cc: netdev, yoshfuji, steffen.klassert, linux-kernel
From: Romain KUNTZ <r.kuntz@ipflavors.com>
Date: Wed, 16 Jan 2013 23:47:40 +0100
> Commit 299b0767 (ipv6: Fix IPsec slowpath fragmentation problem)
> has introduced a error in the header length calculation that
> provokes corrupted packets when non-fragmentable extensions
> headers (Destination Option or Routing Header Type 2) are used.
>
> rt->rt6i_nfheader_len is the length of the non-fragmentable
> extension header, and it should be substracted to
> rt->dst.header_len, and not to exthdrlen, as it was done before
> commit 299b0767.
>
> This patch reverts to the original and correct behavior. It has
> been successfully tested with and without IPsec on packets
> that include non-fragmentable extensions headers.
>
> Signed-off-by: Romain Kuntz <r.kuntz@ipflavors.com>
> Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-17 8:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 22:47 [PATCH 1/1] ipv6: fix header length calculation in ip6_append_data() Romain KUNTZ
2013-01-17 8:37 ` David Miller
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).