Skip to content

Commit 5c25f30

Browse files
lxindavem330
authored andcommitted
ip6_gre: update mtu properly in ip6gre_err
Now when probessing ICMPV6_PKT_TOOBIG, ip6gre_err only subtracts the offset of gre header from mtu info. The expected mtu of gre device should also subtract gre header. Otherwise, the next packets still can't be sent out. Jianlin found this issue when using the topo: client(ip6gre)<---->(nic1)route(nic2)<----->(ip6gre)server and reducing nic2's mtu, then both tcp and sctp's performance with big size data became 0. This patch is to fix it by also subtracting grehdr (tun->tun_hlen) from mtu info when updating gre device's mtu in ip6gre_err(). It also needs to subtract ETH_HLEN if gre dev'type is ARPHRD_ETHER. 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>
1 parent 8053238 commit 5c25f30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/ipv6/ip6_gre.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
432432
}
433433
break;
434434
case ICMPV6_PKT_TOOBIG:
435-
mtu = be32_to_cpu(info) - offset;
435+
mtu = be32_to_cpu(info) - offset - t->tun_hlen;
436+
if (t->dev->type == ARPHRD_ETHER)
437+
mtu -= ETH_HLEN;
436438
if (mtu < IPV6_MIN_MTU)
437439
mtu = IPV6_MIN_MTU;
438440
t->dev->mtu = mtu;

0 commit comments

Comments
 (0)