# \[patch net-next v3 06/28\] net: add netif\_is\_lag\_master helper

- From: Jiri Pirko \<jiri@resnulli.us\>
- Date: 2015-12-03 11:12:45 
- List: netdev
- Page: https://ratatoskr.run/netdev/2015/12/11003942
- Thread: https://ratatoskr.run/netdev/2015/12/11003963/t.md

```text
From: Jiri Pirko <redacted>

Some code does not mind if the master is bond or team and treats them
the same, as generic LAG.

Signed-off-by: Jiri Pirko <redacted>
---
 include/linux/netdevice.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index e7eca8f..b3e96d6 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3900,6 +3900,11 @@ static inline bool netif_is_team_port(struct net_device *dev)
 	return dev->priv_flags & IFF_TEAM_PORT;
 }
 
+static inline bool netif_is_lag_master(struct net_device *dev)
+{
+	return netif_is_bond_master(dev) || netif_is_team_master(dev);
+}
+
 /* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
 static inline void netif_keep_dst(struct net_device *dev)
 {
-- 
1.9.3
```
