aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a4d39b87b4e5..8497feea8fb5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1976,6 +1976,17 @@ static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb)
1976 return false; 1976 return false;
1977} 1977}
1978 1978
1979/**
1980 * dev_nit_active - return true if any network interface taps are in use
1981 *
1982 * @dev: network device to check for the presence of taps
1983 */
1984bool dev_nit_active(struct net_device *dev)
1985{
1986 return !list_empty(&ptype_all) || !list_empty(&dev->ptype_all);
1987}
1988EXPORT_SYMBOL_GPL(dev_nit_active);
1989
1979/* 1990/*
1980 * Support routine. Sends outgoing frames to any network 1991 * Support routine. Sends outgoing frames to any network
1981 * taps currently in use. 1992 * taps currently in use.
@@ -3233,7 +3244,7 @@ static int xmit_one(struct sk_buff *skb, struct net_device *dev,
3233 unsigned int len; 3244 unsigned int len;
3234 int rc; 3245 int rc;
3235 3246
3236 if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) 3247 if (dev_nit_active(dev))
3237 dev_queue_xmit_nit(skb, dev); 3248 dev_queue_xmit_nit(skb, dev);
3238 3249
3239 len = skb->len; 3250 len = skb->len;