An extended netlink ack has been added for 4.14 - add compat layer
changes so that it compiles for all kernels up to and including
4.14.

Signed-off-by: Greg Rose <gvrose8...@gmail.com>
---
 acinclude.m4                                    |  3 +++
 datapath/linux/compat/include/linux/netdevice.h | 30 +++++++++++++++++++++----
 datapath/vport-netdev.c                         |  3 ++-
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index c04c2c6..768c20c 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -795,6 +795,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                         [OVS_DEFINE([HAVE_LIST_IN_NF_HOOK_OPS])])
   OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netfilter/nf_conntrack_common.h],
                   [IP_CT_UNTRACKED])
+  OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h],
+                        [netdev_master_upper_dev_link], [extack],
+                        [OVS_DEFINE([HAVE_UPPER_DEV_LINK_EXTACK])])
 
   if cmp -s datapath/linux/kcompat.h.new \
             datapath/linux/kcompat.h >/dev/null 2>&1; then
diff --git a/datapath/linux/compat/include/linux/netdevice.h 
b/datapath/linux/compat/include/linux/netdevice.h
index 3c3cf42..25d5d3a 100644
--- a/datapath/linux/compat/include/linux/netdevice.h
+++ b/datapath/linux/compat/include/linux/netdevice.h
@@ -101,14 +101,36 @@ static inline bool netif_needs_gso(struct sk_buff *skb,
 #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH
 static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev,
                                               struct net_device *upper_dev,
-                                              void *upper_priv, void 
*upper_info)
+                                              void *upper_priv,
+                                              void *upper_info, void *extack)
 {
        return netdev_master_upper_dev_link(dev, upper_dev);
 }
 #define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link
-
-#endif
-#endif
+#else /* #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH */
+static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev,
+                                              struct net_device *upper_dev,
+                                              void *upper_priv,
+                                              void *upper_info, void *extack)
+{
+       return netdev_master_upper_dev_link(dev, upper_dev,
+                                           upper_priv, upper_info);
+}
+#define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link
+#endif /* #else HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH */
+#else  /* #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV */
+#ifndef HAVE_UPPER_DEV_LINK_EXTACK
+static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev,
+                                              struct net_device *upper_dev,
+                                              void *upper_priv,
+                                              void *upper_info, void *extack)
+{
+       return netdev_master_upper_dev_link(dev, upper_dev, upper_priv,
+                                           upper_info);
+}
+#define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link
+#endif /* #ifndef HAVE_UPPER_DEV_LINK_EXTACK */
+#endif /* #else HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)
 #define dev_queue_xmit rpl_dev_queue_xmit
diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c
index 697c442..4eb8816 100644
--- a/datapath/vport-netdev.c
+++ b/datapath/vport-netdev.c
@@ -113,7 +113,8 @@ struct vport *ovs_netdev_link(struct vport *vport, const 
char *name)
 
        rtnl_lock();
        err = netdev_master_upper_dev_link(vport->dev,
-                                          get_dpdev(vport->dp), NULL, NULL);
+                                          get_dpdev(vport->dp),
+                                          NULL, NULL, NULL);
        if (err)
                goto error_unlock;
 
-- 
1.8.3.1

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

Reply via email to