From: Xin Long <lucien....@gmail.com>

Upstream commit:
    commit cfddd4c33c254954927942599d299b3865743146
    Author: Xin Long <lucien....@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 <ji...@redhat.com>
    Signed-off-by: Xin Long <lucien....@gmail.com>
    Signed-off-by: David S. Miller <da...@davemloft.net>

Cc: Xin Long <lucien....@gmail.com>
Signed-off-by: Greg Rose <gvrose8...@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 028586c..f849971 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -367,6 +367,7 @@ 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, hdr_len) == PACKET_RCVD)
@@ -390,7 +391,6 @@ static int gre_rcv(struct sk_buff *skb, const struct 
tnl_ptk_info *__tpi)
 
        if (ipgre_rcv(skb, &tpi, 0) == PACKET_RCVD)
                return 0;
-
 drop:
 
        kfree_skb(skb);
@@ -1182,6 +1182,7 @@ static void ipgre_tunnel_setup(struct net_device *dev)
 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

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to