Skip to content

Commit 6d428bc

Browse files
lxingregkh
authored andcommitted
ip6_gre: only increase err_count for some certain type icmpv6 in ip6gre_err
[ Upstream commit f8d20b4 ] 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 df0eebc commit 6d428bc

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
@@ -408,13 +408,16 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
408408
case ICMPV6_DEST_UNREACH:
409409
net_dbg_ratelimited("%s: Path to destination invalid or inactive!\n",
410410
t->parms.name);
411-
break;
411+
if (code != ICMPV6_PORT_UNREACH)
412+
break;
413+
return;
412414
case ICMPV6_TIME_EXCEED:
413415
if (code == ICMPV6_EXC_HOPLIMIT) {
414416
net_dbg_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n",
415417
t->parms.name);
418+
break;
416419
}
417-
break;
420+
return;
418421
case ICMPV6_PARAMPROB:
419422
teli = 0;
420423
if (code == ICMPV6_HDR_FIELD)
@@ -430,15 +433,15 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
430433
net_dbg_ratelimited("%s: Recipient unable to parse tunneled packet!\n",
431434
t->parms.name);
432435
}
433-
break;
436+
return;
434437
case ICMPV6_PKT_TOOBIG:
435438
mtu = be32_to_cpu(info) - offset - t->tun_hlen;
436439
if (t->dev->type == ARPHRD_ETHER)
437440
mtu -= ETH_HLEN;
438441
if (mtu < IPV6_MIN_MTU)
439442
mtu = IPV6_MIN_MTU;
440443
t->dev->mtu = mtu;
441-
break;
444+
return;
442445
}
443446

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

0 commit comments

Comments
 (0)