diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-05 08:05:11 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-05 08:05:11 -0400 |
commit | 75d8f2931a803b803cb4a850448460475c20f30b (patch) | |
tree | 9853b9084fa55609c8e4abbc1763bc500e05da50 /net/core/dev.c | |
parent | ffb690d5aa36d38d7bed7579e3f07b84ff6b3a08 (diff) | |
parent | e93c7d1bc350189511d32cec2f0af79c30e7fa47 (diff) |
Merge branch 'asoc-omap' into for-3.7
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index a39354ee1432..83988362805e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1642,6 +1642,19 @@ static inline int deliver_skb(struct sk_buff *skb, | |||
1642 | return pt_prev->func(skb, skb->dev, pt_prev, orig_dev); | 1642 | return pt_prev->func(skb, skb->dev, pt_prev, orig_dev); |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb) | ||
1646 | { | ||
1647 | if (ptype->af_packet_priv == NULL) | ||
1648 | return false; | ||
1649 | |||
1650 | if (ptype->id_match) | ||
1651 | return ptype->id_match(ptype, skb->sk); | ||
1652 | else if ((struct sock *)ptype->af_packet_priv == skb->sk) | ||
1653 | return true; | ||
1654 | |||
1655 | return false; | ||
1656 | } | ||
1657 | |||
1645 | /* | 1658 | /* |
1646 | * Support routine. Sends outgoing frames to any network | 1659 | * Support routine. Sends outgoing frames to any network |
1647 | * taps currently in use. | 1660 | * taps currently in use. |
@@ -1659,8 +1672,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | |||
1659 | * they originated from - MvS (miquels@drinkel.ow.org) | 1672 | * they originated from - MvS (miquels@drinkel.ow.org) |
1660 | */ | 1673 | */ |
1661 | if ((ptype->dev == dev || !ptype->dev) && | 1674 | if ((ptype->dev == dev || !ptype->dev) && |
1662 | (ptype->af_packet_priv == NULL || | 1675 | (!skb_loop_sk(ptype, skb))) { |
1663 | (struct sock *)ptype->af_packet_priv != skb->sk)) { | ||
1664 | if (pt_prev) { | 1676 | if (pt_prev) { |
1665 | deliver_skb(skb2, pt_prev, skb->dev); | 1677 | deliver_skb(skb2, pt_prev, skb->dev); |
1666 | pt_prev = ptype; | 1678 | pt_prev = ptype; |
@@ -5732,6 +5744,7 @@ EXPORT_SYMBOL(netdev_refcnt_read); | |||
5732 | 5744 | ||
5733 | /** | 5745 | /** |
5734 | * netdev_wait_allrefs - wait until all references are gone. | 5746 | * netdev_wait_allrefs - wait until all references are gone. |
5747 | * @dev: target net_device | ||
5735 | * | 5748 | * |
5736 | * This is called when unregistering network devices. | 5749 | * This is called when unregistering network devices. |
5737 | * | 5750 | * |