@@ -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);
@@ -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);
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> --- datapath/linux/compat/lisp.c | 4 ++++ datapath/linux/compat/stt.c | 4 ++++ 2 files changed, 8 insertions(+)