All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* Possible IPv6 fragmentation/pmtud bug
@ 2013-12-05 19:39 Templin, Fred L
  2013-12-05 20:13 ` Templin, Fred L
  0 siblings, 1 reply; 6+ messages in thread
From: Templin, Fred L @ 2013-12-05 19:39 UTC (permalink / raw
  To: netdev@vger.kernel.org

Hi,

I have the following test network configuration (all linux nodes
running the 3.10.17 kernel):


h1 <-----------> r1 <-----------> r2 <-----------> h2
   8000 MTU link    4000 MTU link    8000 MTU link

When host h1 ping6's host h2, routers r1 and r2 forward the ICMPv6
echo request/reply packets as expected. But, when I set a ping6
packet size that is larger than the router-to-router link MTU:

  h1# ping6 -s 5000 h2

router r1 does NOT send an ICMPv6 Packet Too Big message back
to host h1 but rather fragments the ICMPv6 echo request packets
itself before forwarding on to router r2 then ultimately host h1.
The ping6's still succeed because of IPv6 fragmentation, but it
is *router r1* that is doing the fragmentation instead of host h1.

This seems to be related to the setting of the "skb->local_df" flag,
which should only be set for locally-generated packets; not for
packets that are being forwarded by a router. Does anyone have any
idea as to why my router is performing fragmentation when it forwards
an ICMPv6 packet?

Thanks - Fred
fred.l.templin@boeing.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Possible IPv6 fragmentation/pmtud bug
  2013-12-05 19:39 Possible IPv6 fragmentation/pmtud bug Templin, Fred L
@ 2013-12-05 20:13 ` Templin, Fred L
  2013-12-05 20:18   ` Hannes Frederic Sowa
  0 siblings, 1 reply; 6+ messages in thread
From: Templin, Fred L @ 2013-12-05 20:13 UTC (permalink / raw
  To: netdev@vger.kernel.org

Another clue that I should have mentioned in my initial message; the
"hosts", "routers" and "links" are not physical nodes but rather
network namespace virtual nodes running within a single linux 3.10.17
emulation server. Could there be some sort of weird "cross-talk"
between VMs that is making the router believe it is a host?

Thanks - Fred
fred.l.templin@boeing.com 

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Templin, Fred L
> Sent: Thursday, December 05, 2013 11:40 AM
> To: netdev@vger.kernel.org
> Subject: Possible IPv6 fragmentation/pmtud bug
> 
> Hi,
> 
> I have the following test network configuration (all linux nodes
> running the 3.10.17 kernel):
> 
> 
> h1 <-----------> r1 <-----------> r2 <-----------> h2
>    8000 MTU link    4000 MTU link    8000 MTU link
> 
> When host h1 ping6's host h2, routers r1 and r2 forward the ICMPv6
> echo request/reply packets as expected. But, when I set a ping6
> packet size that is larger than the router-to-router link MTU:
> 
>   h1# ping6 -s 5000 h2
> 
> router r1 does NOT send an ICMPv6 Packet Too Big message back
> to host h1 but rather fragments the ICMPv6 echo request packets
> itself before forwarding on to router r2 then ultimately host h1.
> The ping6's still succeed because of IPv6 fragmentation, but it
> is *router r1* that is doing the fragmentation instead of host h1.
> 
> This seems to be related to the setting of the "skb->local_df" flag,
> which should only be set for locally-generated packets; not for
> packets that are being forwarded by a router. Does anyone have any
> idea as to why my router is performing fragmentation when it forwards
> an ICMPv6 packet?
> 
> Thanks - Fred
> fred.l.templin@boeing.com
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Possible IPv6 fragmentation/pmtud bug
  2013-12-05 20:13 ` Templin, Fred L
@ 2013-12-05 20:18   ` Hannes Frederic Sowa
  2013-12-05 22:29     ` [PATCH] net: clear local_df when passing skb between namespaces Hannes Frederic Sowa
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Frederic Sowa @ 2013-12-05 20:18 UTC (permalink / raw
  To: Templin, Fred L; +Cc: netdev@vger.kernel.org

On Thu, Dec 05, 2013 at 08:13:25PM +0000, Templin, Fred L wrote:
> Another clue that I should have mentioned in my initial message; the
> "hosts", "routers" and "links" are not physical nodes but rather
> network namespace virtual nodes running within a single linux 3.10.17
> emulation server. Could there be some sort of weird "cross-talk"
> between VMs that is making the router believe it is a host?

That is probable. With a quick test I could not reproduce it. I guess we don't
reset skb->local_df after creation. I'll check it out.

Thanks for the report,

  Hannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] net: clear local_df when passing skb between namespaces
  2013-12-05 20:18   ` Hannes Frederic Sowa
@ 2013-12-05 22:29     ` Hannes Frederic Sowa
  2013-12-05 22:52       ` Templin, Fred L
  2013-12-06  4:43       ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Hannes Frederic Sowa @ 2013-12-05 22:29 UTC (permalink / raw
  To: Templin, Fred L, netdev@vger.kernel.org

We must clear local_df when passing the skb between namespaces as the
packet is not local to the new namespace any more and thus may not get
fragmented by local rules. Fred Templin noticed that other namespaces
do fragment IPv6 packets while forwarding. Instead they should have send
back a PTB.

The same problem should be present when forwarding DF-IPv4 packets
between namespaces.

Reported-by: Templin, Fred L <Fred.L.Templin@boeing.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/core/skbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 2718fed..06e72d3 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3584,6 +3584,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
 	skb->tstamp.tv64 = 0;
 	skb->pkt_type = PACKET_HOST;
 	skb->skb_iif = 0;
+	skb->local_df = 0;
 	skb_dst_drop(skb);
 	skb->mark = 0;
 	secpath_reset(skb);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH] net: clear local_df when passing skb between namespaces
  2013-12-05 22:29     ` [PATCH] net: clear local_df when passing skb between namespaces Hannes Frederic Sowa
@ 2013-12-05 22:52       ` Templin, Fred L
  2013-12-06  4:43       ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Templin, Fred L @ 2013-12-05 22:52 UTC (permalink / raw
  To: Hannes Frederic Sowa, netdev@vger.kernel.org

Concur - testing on an earlier kernel version shows that clearing
local_df solves the problem.

Fred

> -----Original Message-----
> From: Hannes Frederic Sowa [mailto:hannes@stressinduktion.org]
> Sent: Thursday, December 05, 2013 2:29 PM
> To: Templin, Fred L; netdev@vger.kernel.org
> Subject: [PATCH] net: clear local_df when passing skb between namespaces
> 
> We must clear local_df when passing the skb between namespaces as the
> packet is not local to the new namespace any more and thus may not get
> fragmented by local rules. Fred Templin noticed that other namespaces
> do fragment IPv6 packets while forwarding. Instead they should have send
> back a PTB.
> 
> The same problem should be present when forwarding DF-IPv4 packets
> between namespaces.
> 
> Reported-by: Templin, Fred L <Fred.L.Templin@boeing.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>  net/core/skbuff.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 2718fed..06e72d3 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -3584,6 +3584,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
>  	skb->tstamp.tv64 = 0;
>  	skb->pkt_type = PACKET_HOST;
>  	skb->skb_iif = 0;
> +	skb->local_df = 0;
>  	skb_dst_drop(skb);
>  	skb->mark = 0;
>  	secpath_reset(skb);
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net: clear local_df when passing skb between namespaces
  2013-12-05 22:29     ` [PATCH] net: clear local_df when passing skb between namespaces Hannes Frederic Sowa
  2013-12-05 22:52       ` Templin, Fred L
@ 2013-12-06  4:43       ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2013-12-06  4:43 UTC (permalink / raw
  To: hannes; +Cc: Fred.L.Templin, netdev

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Thu, 5 Dec 2013 23:29:19 +0100

> We must clear local_df when passing the skb between namespaces as the
> packet is not local to the new namespace any more and thus may not get
> fragmented by local rules. Fred Templin noticed that other namespaces
> do fragment IPv6 packets while forwarding. Instead they should have send
> back a PTB.
> 
> The same problem should be present when forwarding DF-IPv4 packets
> between namespaces.
> 
> Reported-by: Templin, Fred L <Fred.L.Templin@boeing.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Applied and queued up for -stable, thanks Hannes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-06  4:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 19:39 Possible IPv6 fragmentation/pmtud bug Templin, Fred L
2013-12-05 20:13 ` Templin, Fred L
2013-12-05 20:18   ` Hannes Frederic Sowa
2013-12-05 22:29     ` [PATCH] net: clear local_df when passing skb between namespaces Hannes Frederic Sowa
2013-12-05 22:52       ` Templin, Fred L
2013-12-06  4:43       ` David Miller

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.