From 8cdd85766293018fea01512959320a05269e97b4 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 13 Oct 2017 10:48:42 +0200 Subject: backports: add netdev_upper_dev_link() extack argument But make it optional (using magic.h) to let this still work on kernels that didn't change the argument. Signed-off-by: Johannes Berg --- backport/backport-include/linux/netdevice.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 9c912285..d92c95ad 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -3,6 +3,7 @@ #include_next #include #include +#include /* * This is declared implicitly in newer kernels by netdevice.h using @@ -333,4 +334,18 @@ static inline void netif_trans_update(struct net_device *dev) (_dev)->needs_free_netdev = true; #endif +#if LINUX_VERSION_IS_LESS(4,14,0) +static inline int _bp_netdev_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev) +{ + return netdev_upper_dev_link(dev, upper_dev); +} +#define netdev_upper_dev_link3(dev, upper, extack) \ + netdev_upper_dev_link(dev, upper) +#define netdev_upper_dev_link2(dev, upper) \ + netdev_upper_dev_link(dev, upper) +#define netdev_upper_dev_link(...) \ + macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__) +#endif + #endif /* __BACKPORT_NETDEVICE_H */ -- cgit v1.2.3