Skip to content

Commit 8ef9ba4

Browse files
taktv6kuba-moo
authored andcommitted
IPv6: Set SIT tunnel hard_header_len to zero
Due to the legacy usage of hard_header_len for SIT tunnels while already using infrastructure from net/ipv4/ip_tunnel.c the calculation of the path MTU in tnl_update_pmtu is incorrect. This leads to unnecessary creation of MTU exceptions for any flow going over a SIT tunnel. As SIT tunnels do not have a header themsevles other than their transport (L3, L2) headers we're leaving hard_header_len set to zero as tnl_update_pmtu is already taking care of the transport headers sizes. This will also help avoiding unnecessary IPv6 GC runs and spinlock contention seen when using SIT tunnels and for more than net.ipv6.route.gc_thresh flows. Fixes: c544193 ("GRE: Refactor GRE tunneling code.") Signed-off-by: Oliver Herms <oliver.peter.herms@gmail.com> Acked-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20201103104133.GA1573211@tws Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 4e0396c commit 8ef9ba4

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

net/ipv6/sit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)
11281128
if (tdev && !netif_is_l3_master(tdev)) {
11291129
int t_hlen = tunnel->hlen + sizeof(struct iphdr);
11301130

1131-
dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr);
11321131
dev->mtu = tdev->mtu - t_hlen;
11331132
if (dev->mtu < IPV6_MIN_MTU)
11341133
dev->mtu = IPV6_MIN_MTU;
@@ -1426,7 +1425,6 @@ static void ipip6_tunnel_setup(struct net_device *dev)
14261425
dev->priv_destructor = ipip6_dev_free;
14271426

14281427
dev->type = ARPHRD_SIT;
1429-
dev->hard_header_len = LL_MAX_HEADER + t_hlen;
14301428
dev->mtu = ETH_DATA_LEN - t_hlen;
14311429
dev->min_mtu = IPV6_MIN_MTU;
14321430
dev->max_mtu = IP6_MAX_MTU - t_hlen;

0 commit comments

Comments
 (0)