* [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6
@ 2010-04-19 2:58 ` Shan Wei
0 siblings, 0 replies; 8+ messages in thread
From: Shan Wei @ 2010-04-19 2:58 UTC (permalink / raw)
To: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
魏勇军, vladislav.yasevich
Cc: kuznet, pekkas, jmorris, Patrick McHardy, eric.dumazet, Shan Wei,
sri, Herbert Xu, netdev@vger.kernel.org, linux-sctp
According to RFC2460, PMTU is set to the IPv6 Minimum Link
MTU (1280) and a fragment header should always be included
after a node receiving Too Big message reporting PMTU is
less than the IPv6 Minimum Link MTU.
After receiving a ICMPv6 Too Big message reporting PMTU is
less than the IPv6 Minimum Link MTU, sctp *can't* send any
data/control chunk that total length including IPv6 head
and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
The failure occured in p6_fragment(), about reason
see following(take SHUTDOWN chunk for example):
sctp_packet_transmit (SHUTDOWN chunk, len\x16 byte)
|------sctp_v6_xmit (local_df=0)
|------ip6_xmit
|------ip6_output (dst_allfrag is ture)
|------ip6_fragment
In ip6_fragment(), for local_df=0, drops the the packet
and returns EMSGSIZE.
The patch fixes it with adding check length of skb->len.
In this case, Ipv6 not to fragment upper protocol data,
just only add a fragment header before it.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/ip6_output.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 5129a16..c3edb6c 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -625,7 +625,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
/* We must not fragment if the socket is set to force MTU discovery
* or if the skb it not generated by a local socket.
*/
- if (!skb->local_df) {
+ if (!skb->local_df && skb->len > mtu) {
skb->dev = skb_dst(skb)->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
--
1.6.3.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU
@ 2010-04-19 2:58 ` Shan Wei
0 siblings, 0 replies; 8+ messages in thread
From: Shan Wei @ 2010-04-19 2:58 UTC (permalink / raw)
To: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
魏勇军, vladislav.yasevich
Cc: kuznet, pekkas, jmorris, Patrick McHardy, eric.dumazet, Shan Wei,
sri, Herbert Xu, netdev@vger.kernel.org, linux-sctp
According to RFC2460, PMTU is set to the IPv6 Minimum Link
MTU (1280) and a fragment header should always be included
after a node receiving Too Big message reporting PMTU is
less than the IPv6 Minimum Link MTU.
After receiving a ICMPv6 Too Big message reporting PMTU is
less than the IPv6 Minimum Link MTU, sctp *can't* send any
data/control chunk that total length including IPv6 head
and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
The failure occured in p6_fragment(), about reason
see following(take SHUTDOWN chunk for example):
sctp_packet_transmit (SHUTDOWN chunk, len=16 byte)
|------sctp_v6_xmit (local_df=0)
|------ip6_xmit
|------ip6_output (dst_allfrag is ture)
|------ip6_fragment
In ip6_fragment(), for local_df=0, drops the the packet
and returns EMSGSIZE.
The patch fixes it with adding check length of skb->len.
In this case, Ipv6 not to fragment upper protocol data,
just only add a fragment header before it.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/ip6_output.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 5129a16..c3edb6c 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -625,7 +625,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
/* We must not fragment if the socket is set to force MTU discovery
* or if the skb it not generated by a local socket.
*/
- if (!skb->local_df) {
+ if (!skb->local_df && skb->len > mtu) {
skb->dev = skb_dst(skb)->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
--
1.6.3.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH BUG-FIX] ipv6: allow to send packet after receiving
2010-04-19 2:58 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU Shan Wei
@ 2010-04-19 3:55 ` Herbert Xu
-1 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2010-04-19 3:55 UTC (permalink / raw)
To: Shan Wei
Cc: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
魏勇军, vladislav.yasevich, kuznet, pekkas,
jmorris, Patrick McHardy, eric.dumazet, sri,
netdev@vger.kernel.org, linux-sctp
On Mon, Apr 19, 2010 at 10:58:22AM +0800, Shan Wei wrote:
>
> According to RFC2460, PMTU is set to the IPv6 Minimum Link
> MTU (1280) and a fragment header should always be included
> after a node receiving Too Big message reporting PMTU is
> less than the IPv6 Minimum Link MTU.
>
> After receiving a ICMPv6 Too Big message reporting PMTU is
> less than the IPv6 Minimum Link MTU, sctp *can't* send any
> data/control chunk that total length including IPv6 head
> and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
>
> The failure occured in p6_fragment(), about reason
> see following(take SHUTDOWN chunk for example):
> sctp_packet_transmit (SHUTDOWN chunk, len\x16 byte)
> |------sctp_v6_xmit (local_df=0)
> |------ip6_xmit
> |------ip6_output (dst_allfrag is ture)
> |------ip6_fragment
>
> In ip6_fragment(), for local_df=0, drops the the packet
> and returns EMSGSIZE.
>
> The patch fixes it with adding check length of skb->len.
> In this case, Ipv6 not to fragment upper protocol data,
> just only add a fragment header before it.
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
The patch looks good to me.
If we wanted to optimise the allfrags case it may be better
to reserve the space beforehand and generate the fragment header
at the same time as we're doing the IPv6 header.
But it can't be all that important as it's been broken for so
many years.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" 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] 8+ messages in thread* Re: [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU
@ 2010-04-19 3:55 ` Herbert Xu
0 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2010-04-19 3:55 UTC (permalink / raw)
To: Shan Wei
Cc: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
魏勇军, vladislav.yasevich, kuznet, pekkas,
jmorris, Patrick McHardy, eric.dumazet, sri,
netdev@vger.kernel.org, linux-sctp
On Mon, Apr 19, 2010 at 10:58:22AM +0800, Shan Wei wrote:
>
> According to RFC2460, PMTU is set to the IPv6 Minimum Link
> MTU (1280) and a fragment header should always be included
> after a node receiving Too Big message reporting PMTU is
> less than the IPv6 Minimum Link MTU.
>
> After receiving a ICMPv6 Too Big message reporting PMTU is
> less than the IPv6 Minimum Link MTU, sctp *can't* send any
> data/control chunk that total length including IPv6 head
> and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
>
> The failure occured in p6_fragment(), about reason
> see following(take SHUTDOWN chunk for example):
> sctp_packet_transmit (SHUTDOWN chunk, len=16 byte)
> |------sctp_v6_xmit (local_df=0)
> |------ip6_xmit
> |------ip6_output (dst_allfrag is ture)
> |------ip6_fragment
>
> In ip6_fragment(), for local_df=0, drops the the packet
> and returns EMSGSIZE.
>
> The patch fixes it with adding check length of skb->len.
> In this case, Ipv6 not to fragment upper protocol data,
> just only add a fragment header before it.
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
The patch looks good to me.
If we wanted to optimise the allfrags case it may be better
to reserve the space beforehand and generate the fragment header
at the same time as we're doing the IPv6 header.
But it can't be all that important as it's been broken for so
many years.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6
2010-04-19 3:55 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU Herbert Xu
@ 2010-04-19 6:49 ` Shan Wei
-1 siblings, 0 replies; 8+ messages in thread
From: Shan Wei @ 2010-04-19 6:49 UTC (permalink / raw)
To: Herbert Xu
Cc: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
魏勇军, vladislav.yasevich, kuznet, pekkas,
jmorris, Patrick McHardy, eric.dumazet, sri,
netdev@vger.kernel.org, linux-sctp
Herbert Xu wrote, at 04/19/2010 11:55 AM:
>
> The patch looks good to me.
Thanks for reviewing this patch.
> If we wanted to optimise the allfrags case it may be better
> to reserve the space beforehand and generate the fragment header
> at the same time as we're doing the IPv6 header.
>
> But it can't be all that important as it's been broken for so
> many years.
If somebody needs one patch to fix the broken,
I am pleased to do so.
--
Best Regards
-----
Shan Wei
>
> Thanks,
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU
@ 2010-04-19 6:49 ` Shan Wei
0 siblings, 0 replies; 8+ messages in thread
From: Shan Wei @ 2010-04-19 6:49 UTC (permalink / raw)
To: Herbert Xu
Cc: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
魏勇军, vladislav.yasevich, kuznet, pekkas,
jmorris, Patrick McHardy, eric.dumazet, sri,
netdev@vger.kernel.org, linux-sctp
Herbert Xu wrote, at 04/19/2010 11:55 AM:
>
> The patch looks good to me.
Thanks for reviewing this patch.
> If we wanted to optimise the allfrags case it may be better
> to reserve the space beforehand and generate the fragment header
> at the same time as we're doing the IPv6 header.
>
> But it can't be all that important as it's been broken for so
> many years.
If somebody needs one patch to fix the broken,
I am pleased to do so.
--
Best Regards
-----
Shan Wei
>
> Thanks,
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH BUG-FIX] ipv6: allow to send packet after receiving
2010-04-19 3:55 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU Herbert Xu
@ 2010-04-22 5:48 ` David Miller
-1 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-04-22 5:48 UTC (permalink / raw)
To: herbert
Cc: shanwei, yoshfuji, yjwei, vladislav.yasevich, kuznet, pekkas,
jmorris, kaber, eric.dumazet, sri, netdev, linux-sctp
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 19 Apr 2010 11:55:35 +0800
> On Mon, Apr 19, 2010 at 10:58:22AM +0800, Shan Wei wrote:
>>
>> According to RFC2460, PMTU is set to the IPv6 Minimum Link
>> MTU (1280) and a fragment header should always be included
>> after a node receiving Too Big message reporting PMTU is
>> less than the IPv6 Minimum Link MTU.
>>
>> After receiving a ICMPv6 Too Big message reporting PMTU is
>> less than the IPv6 Minimum Link MTU, sctp *can't* send any
>> data/control chunk that total length including IPv6 head
>> and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
>>
>> The failure occured in p6_fragment(), about reason
>> see following(take SHUTDOWN chunk for example):
>> sctp_packet_transmit (SHUTDOWN chunk, len\x16 byte)
>> |------sctp_v6_xmit (local_df=0)
>> |------ip6_xmit
>> |------ip6_output (dst_allfrag is ture)
>> |------ip6_fragment
>>
>> In ip6_fragment(), for local_df=0, drops the the packet
>> and returns EMSGSIZE.
>>
>> The patch fixes it with adding check length of skb->len.
>> In this case, Ipv6 not to fragment upper protocol data,
>> just only add a fragment header before it.
>>
>> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
>
> The patch looks good to me.
>
> If we wanted to optimise the allfrags case it may be better
> to reserve the space beforehand and generate the fragment header
> at the same time as we're doing the IPv6 header.
>
> But it can't be all that important as it's been broken for so
> many years.
Right, I've applied Shan's patch, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU
@ 2010-04-22 5:48 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-04-22 5:48 UTC (permalink / raw)
To: herbert
Cc: shanwei, yoshfuji, yjwei, vladislav.yasevich, kuznet, pekkas,
jmorris, kaber, eric.dumazet, sri, netdev, linux-sctp
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 19 Apr 2010 11:55:35 +0800
> On Mon, Apr 19, 2010 at 10:58:22AM +0800, Shan Wei wrote:
>>
>> According to RFC2460, PMTU is set to the IPv6 Minimum Link
>> MTU (1280) and a fragment header should always be included
>> after a node receiving Too Big message reporting PMTU is
>> less than the IPv6 Minimum Link MTU.
>>
>> After receiving a ICMPv6 Too Big message reporting PMTU is
>> less than the IPv6 Minimum Link MTU, sctp *can't* send any
>> data/control chunk that total length including IPv6 head
>> and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
>>
>> The failure occured in p6_fragment(), about reason
>> see following(take SHUTDOWN chunk for example):
>> sctp_packet_transmit (SHUTDOWN chunk, len=16 byte)
>> |------sctp_v6_xmit (local_df=0)
>> |------ip6_xmit
>> |------ip6_output (dst_allfrag is ture)
>> |------ip6_fragment
>>
>> In ip6_fragment(), for local_df=0, drops the the packet
>> and returns EMSGSIZE.
>>
>> The patch fixes it with adding check length of skb->len.
>> In this case, Ipv6 not to fragment upper protocol data,
>> just only add a fragment header before it.
>>
>> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
>
> The patch looks good to me.
>
> If we wanted to optimise the allfrags case it may be better
> to reserve the space beforehand and generate the fragment header
> at the same time as we're doing the IPv6 header.
>
> But it can't be all that important as it's been broken for so
> many years.
Right, I've applied Shan's patch, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-04-22 5:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 2:58 [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Shan Wei
2010-04-19 2:58 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU Shan Wei
2010-04-19 3:55 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving Herbert Xu
2010-04-19 3:55 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU Herbert Xu
2010-04-19 6:49 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Shan Wei
2010-04-19 6:49 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU Shan Wei
2010-04-22 5:48 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving David Miller
2010-04-22 5:48 ` [PATCH BUG-FIX] ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU 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.