diff mbox series

[9/9] backports: netdevice: Add netif_is_bridge_port()

Message ID 20200420221615.14734-10-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to version 5.7-rc2 | expand

Commit Message

Hauke Mehrtens April 20, 2020, 10:16 p.m. UTC
netif_is_bridge_port() was added in upstream Linux commit 28f9ee22bcdd
("vlan: Do not put vlan headers back on bridge and macvlan ports").

It is now used by the wireless subsystem.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/netdevice.h | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index a71ed590..edb0aaf3 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -380,4 +380,12 @@  static inline int backport_dev_open(struct net_device *dev, struct netlink_ext_a
 #define dev_open LINUX_BACKPORT(dev_open)
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,4,0)
+#define netif_is_bridge_port LINUX_BACKPORT(netif_is_bridge_port)
+static inline bool netif_is_bridge_port(const struct net_device *dev)
+{
+	return dev->priv_flags & IFF_BRIDGE_PORT;
+}
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */