[ovs-dev,ERSPAN,RFC,13/25] ip_gre: remove the incorrect mtu limit for ipgre tap

Message ID 1521756461-3870-14-git-send-email-gvrose8192@gmail.com
State RFC
Headers show
  • Introduce ERSPAN for OVS
Related show

Commit Message

Gregory Rose March 22, 2018, 10:07 p.m.
From: Xin Long <lucien.xin@gmail.com>

Upstream commit:
    commit cfddd4c33c254954927942599d299b3865743146
    Author: Xin Long <lucien.xin@gmail.com>
    Date:   Mon Dec 18 14:24:35 2017 +0800

    ip_gre: remove the incorrect mtu limit for ipgre tap

    ipgre tap driver calls ether_setup(), after commit 61e84623ace3
    ("net: centralize net_device min/max MTU checking"), the range
    of mtu is [min_mtu, max_mtu], which is [68, 1500] by default.

    It causes the dev mtu of the ipgre tap device to not be greater
    than 1500, this limit value is not correct for ipgre tap device.

    Besides, it's .change_mtu already does the right check. So this
    patch is just to set max_mtu as 0, and leave the check to it's

    Fixes: 61e84623ace3 ("net: centralize net_device min/max MTU checking")
    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>

Cc: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
 datapath/linux/compat/ip_gre.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 9863dd7..7cd35a3 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -290,11 +290,11 @@  static int gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *unused_tpi)
 	if (unlikely(tpi.proto == htons(ETH_P_ERSPAN))) {
 		if (erspan_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)
 			return 0;
+		goto drop;
 	if (ipgre_rcv(skb, &tpi) == PACKET_RCVD)
 		return 0;
@@ -867,6 +867,7 @@  static const struct net_device_ops erspan_netdev_ops = {
 static void ipgre_tap_setup(struct net_device *dev)
+	dev->max_mtu = 0;
 	dev->netdev_ops		= &gre_tap_netdev_ops;
 	dev->priv_flags		|= IFF_LIVE_ADDR_CHANGE;
 	ip_tunnel_setup(dev, gre_tap_net_id);