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

Greg Rose gvrose8192 at gmail.com
Thu Mar 22 22:07:29 UTC 2018


From: Xin Long <lucien.xin at gmail.com>

Upstream commit:
    commit cfddd4c33c254954927942599d299b3865743146
    Author: Xin Long <lucien.xin at 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
    .change_mtu.

    Fixes: 61e84623ace3 ("net: centralize net_device min/max MTU checking")
    Reported-by: Jianlin Shi <jishi at redhat.com>
    Signed-off-by: Xin Long <lucien.xin at gmail.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Cc: Xin Long <lucien.xin at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at 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;
-
 drop:
 
 	kfree_skb(skb);
@@ -867,6 +867,7 @@ static const struct net_device_ops erspan_netdev_ops = {
 static void ipgre_tap_setup(struct net_device *dev)
 {
 	ether_setup(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);
-- 
1.8.3.1



More information about the dev mailing list