[ovs-dev] [PATCH 2/3] datapath: Fix ip6_gre, ip6_tunnel, and ip_gre backport

Yi-Hung Wei yihung.wei at gmail.com
Tue Jun 12 00:50:22 UTC 2018


Recently added ERSAPN feature introduced changes in ip6_gre, ip6_tunnel,
and ip_gre which will break build on RHEL 7.5 kernel because of
ndo_change_mtu().  This patch fixes the issue in RHEL 7.5 kernel.

Fixes: 8e53509c ("gre: introduce native tunnel support for ERSPAN")
Fixes: c387d817 ("compat: Add ipv6 GRE and IPV6 Tunneling")
Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
---
 datapath/linux/compat/ip6_gre.c    | 15 +++++++++++++++
 datapath/linux/compat/ip6_tunnel.c |  5 +++++
 datapath/linux/compat/ip_gre.c     | 10 ++++++++++
 3 files changed, 30 insertions(+)

diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
index dd22240fc962..0c885472df5b 100644
--- a/datapath/linux/compat/ip6_gre.c
+++ b/datapath/linux/compat/ip6_gre.c
@@ -1525,7 +1525,12 @@ static const struct net_device_ops ip6gre_netdev_ops = {
 	.ndo_uninit		= ip6gre_tunnel_uninit,
 	.ndo_start_xmit		= ip6gre_tunnel_xmit,
 	.ndo_do_ioctl		= ip6gre_tunnel_ioctl,
+#ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
+	.extended.ndo_change_mtu = ip6_tnl_change_mtu,
+#else
 	.ndo_change_mtu		= ip6_tnl_change_mtu,
+#endif
 	.ndo_get_stats64	= ip_tunnel_get_stats64,
 #ifdef HAVE_NDO_GET_IFLINK
 	.ndo_get_iflink		= ip6_tnl_get_iflink,
@@ -2010,7 +2015,12 @@ static const struct net_device_ops ip6gre_tap_netdev_ops = {
 	.ndo_start_xmit = ip6gre_tunnel_xmit,
 	.ndo_set_mac_address = eth_mac_addr,
 	.ndo_validate_addr = eth_validate_addr,
+#ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
+	.extended.ndo_change_mtu = ip6_tnl_change_mtu,
+#else
 	.ndo_change_mtu = ip6_tnl_change_mtu,
+#endif
 	.ndo_get_stats64 = ip_tunnel_get_stats64,
 #ifdef HAVE_NDO_GET_IFLINK
 	.ndo_get_iflink = ip6_tnl_get_iflink,
@@ -2073,7 +2083,12 @@ static const struct net_device_ops ip6erspan_netdev_ops = {
 	.ndo_start_xmit =	ip6erspan_tunnel_xmit,
 	.ndo_set_mac_address =	eth_mac_addr,
 	.ndo_validate_addr =	eth_validate_addr,
+#ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
+	.extended.ndo_change_mtu = ip6_tnl_change_mtu,
+#else
 	.ndo_change_mtu =	ip6_tnl_change_mtu,
+#endif
 	.ndo_get_stats64 =	ip_tunnel_get_stats64,
 #ifdef HAVE_NDO_GET_IFLINK
 	.ndo_get_iflink =	ip6_tnl_get_iflink,
diff --git a/datapath/linux/compat/ip6_tunnel.c b/datapath/linux/compat/ip6_tunnel.c
index f6ac069b5281..7c66787967f6 100644
--- a/datapath/linux/compat/ip6_tunnel.c
+++ b/datapath/linux/compat/ip6_tunnel.c
@@ -1612,7 +1612,12 @@ static const struct net_device_ops ip6_tnl_netdev_ops = {
 	.ndo_uninit	= ip6_tnl_dev_uninit,
 	.ndo_start_xmit = ip6_tnl_start_xmit,
 	.ndo_do_ioctl	= ip6_tnl_ioctl,
+#ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
+	.extended.ndo_change_mtu = ip6_tnl_change_mtu,
+#else
 	.ndo_change_mtu = ip6_tnl_change_mtu,
+#endif
 	.ndo_get_stats	= ip6_get_stats,
 #ifdef HAVE_NDO_GET_IFLINK
 	.ndo_get_iflink = ip6_tnl_get_iflink,
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index d35614ee9a73..ac9fb8bfcc88 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -1153,7 +1153,12 @@ static const struct net_device_ops ipgre_netdev_ops = {
 	.ndo_init		= ipgre_tunnel_init,
 	.ndo_uninit		= rpl_ip_tunnel_uninit,
 	.ndo_start_xmit		= ipgre_xmit,
+#ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
+	.extended.ndo_change_mtu = ip_tunnel_change_mtu,
+#else
 	.ndo_change_mtu		= ip_tunnel_change_mtu,
+#endif
 	.ndo_get_stats64	= ip_tunnel_get_stats64,
 #ifdef HAVE_GET_LINK_NET
 	.ndo_get_iflink		= ip_tunnel_get_iflink,
@@ -1187,7 +1192,12 @@ static const struct net_device_ops erspan_netdev_ops = {
 	.ndo_start_xmit		= erspan_xmit,
 	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
+#ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
+	.extended.ndo_change_mtu = ip_tunnel_change_mtu,
+#else
 	.ndo_change_mtu		= ip_tunnel_change_mtu,
+#endif
 	.ndo_get_stats64	= ip_tunnel_get_stats64,
 #ifdef HAVE_NDO_GET_IFLINK
 	.ndo_get_iflink		= rpl_ip_tunnel_get_iflink,
-- 
2.7.4



More information about the dev mailing list