* [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data
@ 2014-02-21 1:55 Hannes Frederic Sowa
2014-02-22 5:28 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2014-02-21 1:55 UTC (permalink / raw)
To: netdev
Currently we generate a new fragmentation id on UFO segmentation. It
is pretty hairy to identify the correct net namespace and dst there.
Especially tunnels use IFF_XMIT_DST_RELEASE and thus have no skb_dst
available at all.
This causes unreliable or very predictable ipv6 fragmentation id
generation while segmentation.
Luckily we already have pregenerated the ip6_frag_id in
ip6_ufo_append_data and can use it here.
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/udp_offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c
index e7359f9..b261ee8 100644
--- a/net/ipv6/udp_offload.c
+++ b/net/ipv6/udp_offload.c
@@ -113,7 +113,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen);
fptr->nexthdr = nexthdr;
fptr->reserved = 0;
- ipv6_select_ident(fptr, (struct rt6_info *)skb_dst(skb));
+ fptr->identification = skb_shinfo(skb)->ip6_frag_id;
/* Fragment the skb. ipv6 header and the remaining fields of the
* fragment header are updated in ipv6_gso_segment()
--
1.8.5.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data
2014-02-21 1:55 [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data Hannes Frederic Sowa
@ 2014-02-22 5:28 ` David Miller
2014-02-22 5:52 ` Hannes Frederic Sowa
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2014-02-22 5:28 UTC (permalink / raw)
To: hannes; +Cc: netdev
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Fri, 21 Feb 2014 02:55:35 +0100
> Currently we generate a new fragmentation id on UFO segmentation. It
> is pretty hairy to identify the correct net namespace and dst there.
> Especially tunnels use IFF_XMIT_DST_RELEASE and thus have no skb_dst
> available at all.
>
> This causes unreliable or very predictable ipv6 fragmentation id
> generation while segmentation.
>
> Luckily we already have pregenerated the ip6_frag_id in
> ip6_ufo_append_data and can use it here.
>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied, thanks Hannes.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data
2014-02-22 5:28 ` David Miller
@ 2014-02-22 5:52 ` Hannes Frederic Sowa
2014-02-25 19:09 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2014-02-22 5:52 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Hi David!
On Sat, Feb 22, 2014 at 12:28:55AM -0500, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Fri, 21 Feb 2014 02:55:35 +0100
>
> > Currently we generate a new fragmentation id on UFO segmentation. It
> > is pretty hairy to identify the correct net namespace and dst there.
> > Especially tunnels use IFF_XMIT_DST_RELEASE and thus have no skb_dst
> > available at all.
> >
> > This causes unreliable or very predictable ipv6 fragmentation id
> > generation while segmentation.
> >
> > Luckily we already have pregenerated the ip6_frag_id in
> > ip6_ufo_append_data and can use it here.
> >
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>
> Applied, thanks Hannes.
Could you also get this at least into 3.13, as sit tunnels enable gso
by default there?
Thank you,
Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data
2014-02-22 5:52 ` Hannes Frederic Sowa
@ 2014-02-25 19:09 ` David Miller
2014-02-26 13:42 ` Hannes Frederic Sowa
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2014-02-25 19:09 UTC (permalink / raw)
To: hannes; +Cc: netdev
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Sat, 22 Feb 2014 06:52:31 +0100
> Hi David!
>
> On Sat, Feb 22, 2014 at 12:28:55AM -0500, David Miller wrote:
>> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> Date: Fri, 21 Feb 2014 02:55:35 +0100
>>
>> > Currently we generate a new fragmentation id on UFO segmentation. It
>> > is pretty hairy to identify the correct net namespace and dst there.
>> > Especially tunnels use IFF_XMIT_DST_RELEASE and thus have no skb_dst
>> > available at all.
>> >
>> > This causes unreliable or very predictable ipv6 fragmentation id
>> > generation while segmentation.
>> >
>> > Luckily we already have pregenerated the ip6_frag_id in
>> > ip6_ufo_append_data and can use it here.
>> >
>> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>>
>> Applied, thanks Hannes.
>
> Could you also get this at least into 3.13, as sit tunnels enable gso
> by default there?
Queueud up for -stable, thanks Hannes.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data
2014-02-25 19:09 ` David Miller
@ 2014-02-26 13:42 ` Hannes Frederic Sowa
0 siblings, 0 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2014-02-26 13:42 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Tue, Feb 25, 2014 at 02:09:11PM -0500, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Sat, 22 Feb 2014 06:52:31 +0100
>
> > Hi David!
> >
> > On Sat, Feb 22, 2014 at 12:28:55AM -0500, David Miller wrote:
> >> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> >> Date: Fri, 21 Feb 2014 02:55:35 +0100
> >>
> >> > Currently we generate a new fragmentation id on UFO segmentation. It
> >> > is pretty hairy to identify the correct net namespace and dst there.
> >> > Especially tunnels use IFF_XMIT_DST_RELEASE and thus have no skb_dst
> >> > available at all.
> >> >
> >> > This causes unreliable or very predictable ipv6 fragmentation id
> >> > generation while segmentation.
> >> >
> >> > Luckily we already have pregenerated the ip6_frag_id in
> >> > ip6_ufo_append_data and can use it here.
> >> >
> >> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> >>
> >> Applied, thanks Hannes.
> >
> > Could you also get this at least into 3.13, as sit tunnels enable gso
> > by default there?
>
> Queueud up for -stable, thanks Hannes.
Just FYI:
While doing some more code review on this part (and in the history), it
seemes we can actually call ipv6_select_ident with ipv4 dsts from time
to time thus using just the random memory available there to generate an
ipv6 address. So this fix is appropriate for all kernels from v2.6.32 on.
We can now remove DST_NOPEER in net-next which was just introduced
because of a bug in this logic and simplify ipv6_select_ident in net-next
(patches coming after net merge to net-next).
Thanks,
Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-26 13:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21 1:55 [PATCH net] ipv6: reuse ip6_frag_id from ip6_ufo_append_data Hannes Frederic Sowa
2014-02-22 5:28 ` David Miller
2014-02-22 5:52 ` Hannes Frederic Sowa
2014-02-25 19:09 ` David Miller
2014-02-26 13:42 ` Hannes Frederic Sowa
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).