diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2011-06-30 03:20:41 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-02 04:33:19 +0400 |
commit | b00897b881f775040653955fda99dcf7c167b382 (patch) | |
tree | 95462798585771d75f9a3febe9b2145414f942c4 /net | |
parent | c146066ab80267c3305de5dda6a4083f06df9265 (diff) | |
download | linux-b00897b881f775040653955fda99dcf7c167b382.tar.xz |
xfrm4: Don't call icmp_send on local error
Calling icmp_send() on a local message size error leads to
an incorrect update of the path mtu. So use ip_local_error()
instead to notify the socket about the error.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/xfrm4_output.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c index 2d51840e53a1..327a617d594c 100644 --- a/net/ipv4/xfrm4_output.c +++ b/net/ipv4/xfrm4_output.c @@ -32,7 +32,12 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb) dst = skb_dst(skb); mtu = dst_mtu(dst); if (skb->len > mtu) { - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); + if (skb->sk) + ip_local_error(skb->sk, EMSGSIZE, ip_hdr(skb)->daddr, + inet_sk(skb->sk)->inet_dport, mtu); + else + icmp_send(skb, ICMP_DEST_UNREACH, + ICMP_FRAG_NEEDED, htonl(mtu)); ret = -EMSGSIZE; } out: |