Skip to content

Commit 5c8a085

Browse files
lxingregkh
authored andcommitted
ip6_gre: only increase err_count for some certain type icmpv6 in ip6gre_err
[ Upstream commit f8d20b46ce55cf40afb30dcef6d9288f7ef46d9b ] The similar fix in patch 'ipip: only increase err_count for some certain type icmp in ipip_err' is needed for ip6gre_err. In Jianlin's case, udp netperf broke even when receiving a TooBig icmpv6 packet. Fixes: c12b395 ("gre: Support GRE over IPv6") Reported-by: Jianlin Shi <jishi@redhat.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 93b12f2 commit 5c8a085

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

net/ipv6/ip6_gre.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,16 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
409409
case ICMPV6_DEST_UNREACH:
410410
net_dbg_ratelimited("%s: Path to destination invalid or inactive!\n",
411411
t->parms.name);
412-
break;
412+
if (code != ICMPV6_PORT_UNREACH)
413+
break;
414+
return;
413415
case ICMPV6_TIME_EXCEED:
414416
if (code == ICMPV6_EXC_HOPLIMIT) {
415417
net_dbg_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n",
416418
t->parms.name);
419+
break;
417420
}
418-
break;
421+
return;
419422
case ICMPV6_PARAMPROB:
420423
teli = 0;
421424
if (code == ICMPV6_HDR_FIELD)
@@ -431,13 +434,13 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
431434
net_dbg_ratelimited("%s: Recipient unable to parse tunneled packet!\n",
432435
t->parms.name);
433436
}
434-
break;
437+
return;
435438
case ICMPV6_PKT_TOOBIG:
436439
mtu = be32_to_cpu(info) - offset;
437440
if (mtu < IPV6_MIN_MTU)
438441
mtu = IPV6_MIN_MTU;
439442
t->dev->mtu = mtu;
440-
break;
443+
return;
441444
}
442445

443446
if (time_before(jiffies, t->err_time + IP6TUNNEL_ERR_TIMEO))

0 commit comments

Comments
 (0)