Message ID | 20130201084515.GA29073@secunet.com |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
On Fri, Feb 01, 2013 at 09:45:15AM +0100, Steffen Klassert wrote: > On Tue, Jan 29, 2013 at 03:43:25PM +0100, Jiri Bohac wrote: > > When the TCP segment reaches ip6_xmit: > > skb->len > dst_mtu(dst_B_xfrm) > > 1452 > 1414 > > This generates an ICMPV6_PKT_TOOBIG to self with MTU==1414. > > This is intended to reach the protocol error handler (decrease > > the MSS in the TCP case): > > I think the above is the problem, we should not send packet to > big messages to ourselves. The reduced mtu is because of some > local reason (e.g. IPsec), it is not learned and therefore we > should not update the pmtu value. > > You could try the patch below. I'm travelling this week, so I > can't do tests myself before monday. > > Subject: [PATCH] ipv6: Don't send packet to big messages to self > > Calling icmpv6_send() on a local message size error leads to an > incorrect update of the path mtu in the case when IPsec is used. > So use ipv6_local_error() instead to notify the socket about the > error. It fixes the problem I was trying to fix. I tested the patch with the PMTU and IPsec parts of the ipv6ready testsuite and it passed. I wonder if this is going to do everything that should be done e.g. in the TCPv6 case. Now, tcp_v6_err() calls tcp_v6_mtu_reduced() which syncs the MSS and forces a retransmit. Looking at the code, I don't think this is going to happen with this patch, so the MSS update and retransmit will only be done when the respective TCP timer expires. So perhaps the individual protocols will need to handle the new error reporting? And out of curiosity, do you know the reason why xfrm[46]_update_pmtu changes the non-xfrm route's MTU? Is this really intended? Thanks,
On Fri, Feb 01, 2013 at 06:25:29PM +0100, Jiri Bohac wrote: > On Fri, Feb 01, 2013 at 09:45:15AM +0100, Steffen Klassert wrote: > > > > Subject: [PATCH] ipv6: Don't send packet to big messages to self > > > > Calling icmpv6_send() on a local message size error leads to an > > incorrect update of the path mtu in the case when IPsec is used. > > So use ipv6_local_error() instead to notify the socket about the > > error. > > It fixes the problem I was trying to fix. > I tested the patch with the PMTU and IPsec parts of the ipv6ready > testsuite and it passed. > > I wonder if this is going to do everything that should be done > e.g. in the TCPv6 case. Now, tcp_v6_err() calls > tcp_v6_mtu_reduced() which syncs the MSS and forces a retransmit. > > Looking at the code, I don't think this is going to happen with > this patch, so the MSS update and retransmit will only be done > when the respective TCP timer expires. > > So perhaps the individual protocols will need to handle the new > error reporting? > Well, we might loose the fast path retransmit. We could think about implementing a fast path for such situations, but that's another issue. Let's fix the bug first, I'll submit the patch to fix it. > > And out of curiosity, do you know the reason why > xfrm[46]_update_pmtu changes the non-xfrm route's MTU? > Is this really intended? > The pmtu is a learned measure of the route, it depends on the external environment, not on the question whether we add local overhead. So I think it was intended to change always the pmtu of the original route, even if we use IPsec. -- 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
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 7dea45a..14fee26 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -242,9 +242,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, dst->dev, dst_output); } - net_dbg_ratelimited("IPv6: sending pkt_too_big to self\n"); skb->dev = dst->dev; - icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); + ipv6_local_error(sk, EMSGSIZE, fl6, mtu); IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); kfree_skb(skb); return -EMSGSIZE;