Skip to content

Commit b00897b

Browse files
klassertdavem330
authored andcommitted
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>
1 parent c146066 commit b00897b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/ipv4/xfrm4_output.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
3232
dst = skb_dst(skb);
3333
mtu = dst_mtu(dst);
3434
if (skb->len > mtu) {
35-
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
35+
if (skb->sk)
36+
ip_local_error(skb->sk, EMSGSIZE, ip_hdr(skb)->daddr,
37+
inet_sk(skb->sk)->inet_dport, mtu);
38+
else
39+
icmp_send(skb, ICMP_DEST_UNREACH,
40+
ICMP_FRAG_NEEDED, htonl(mtu));
3641
ret = -EMSGSIZE;
3742
}
3843
out:

0 commit comments

Comments
 (0)