diff mbox

[ovs-dev,05/11] compat: Implement upstream net device free change.

Message ID 20170721234614.2800-6-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer July 21, 2017, 11:46 p.m. UTC
From: Greg Rose <gvrose8192@gmail.com>

Upstream commit cf124db566e6 ("net: Fix inconsistent teardown and
release of private netdev state.") removed the destructor member
of the net_device structure and replaced it with a boolean flag
indicating that the net device resource needs freeing.  Use
compat flag HAVE_NEEDS_FREE_NETDEV to indicate whether the new
flag should be used.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
---
 datapath/linux/compat/lisp.c | 4 ++++
 datapath/linux/compat/stt.c  | 4 ++++
 2 files changed, 8 insertions(+)
diff mbox

Patch

diff --git a/datapath/linux/compat/lisp.c b/datapath/linux/compat/lisp.c
index 15f851de9ff4..c505fad83a14 100644
--- a/datapath/linux/compat/lisp.c
+++ b/datapath/linux/compat/lisp.c
@@ -580,7 +580,11 @@  static void lisp_setup(struct net_device *dev)
 
 	dev->netdev_ops = &lisp_netdev_ops;
 	dev->ethtool_ops = &lisp_ethtool_ops;
+#ifndef HAVE_NEEDS_FREE_NETDEV
 	dev->destructor = free_netdev;
+#else
+	dev->needs_free_netdev = true;
+#endif
 
 	SET_NETDEV_DEVTYPE(dev, &lisp_type);
 
diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c
index ca9f03988bea..964d993df9cd 100644
--- a/datapath/linux/compat/stt.c
+++ b/datapath/linux/compat/stt.c
@@ -1882,7 +1882,11 @@  static void stt_setup(struct net_device *dev)
 
 	dev->netdev_ops = &stt_netdev_ops;
 	dev->ethtool_ops = &stt_ethtool_ops;
+#ifndef HAVE_NEEDS_FREE_NETDEV
 	dev->destructor = free_netdev;
+#else
+	dev->needs_free_netdev = true;
+#endif
 
 	SET_NETDEV_DEVTYPE(dev, &stt_type);