Skip to content

Commit ffc2b6e

Browse files
lxindavem330
authored andcommitted
ip_gre: fix IFLA_MTU ignored on NEWLINK
It's safe to remove the setting of dev's needed_headroom and mtu in __gre_tunnel_init, as discussed in [1], ip_tunnel_newlink can do it properly. Now Eric noticed that it could cover the mtu value set in do_setlink when creating a ip_gre dev. It makes IFLA_MTU param not take effect. So this patch is to remove them to make IFLA_MTU work, as in other ipv4 tunnels. [1]: https://patchwork.ozlabs.org/patch/823504/ Fixes: c544193 ("GRE: Refactor GRE tunneling code.") Reported-by: Eric Garver <[email protected]> Signed-off-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9c2c2e6 commit ffc2b6e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

net/ipv4/ip_gre.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -970,9 +970,6 @@ static void __gre_tunnel_init(struct net_device *dev)
970970

971971
t_hlen = tunnel->hlen + sizeof(struct iphdr);
972972

973-
dev->needed_headroom = LL_MAX_HEADER + t_hlen + 4;
974-
dev->mtu = ETH_DATA_LEN - t_hlen - 4;
975-
976973
dev->features |= GRE_FEATURES;
977974
dev->hw_features |= GRE_FEATURES;
978975

@@ -1290,8 +1287,6 @@ static int erspan_tunnel_init(struct net_device *dev)
12901287
erspan_hdr_len(tunnel->erspan_ver);
12911288
t_hlen = tunnel->hlen + sizeof(struct iphdr);
12921289

1293-
dev->needed_headroom = LL_MAX_HEADER + t_hlen + 4;
1294-
dev->mtu = ETH_DATA_LEN - t_hlen - 4;
12951290
dev->features |= GRE_FEATURES;
12961291
dev->hw_features |= GRE_FEATURES;
12971292
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

0 commit comments

Comments
 (0)