diff options
author | John Fastabend <john.r.fastabend@intel.com> | 2010-05-12 17:31:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-02 06:35:18 -0400 |
commit | 2df4a0fa1540c460ec69788ab2a901cc72a75644 (patch) | |
tree | cf9fb32c112a2b27eaeccd8a825c15505b32e2d9 /net | |
parent | 194dbcc8a1a97cbac9a619a563e5f6b7f7d5a485 (diff) |
net: fix conflict between null_or_orig and null_or_bond
If a skb is received on an inactive bond that does not meet
the special cases checked for by skb_bond_should_drop it should
only be delivered to exact matches as the comment in
netif_receive_skb() says.
However because null_or_bond could also be null this is not
always true. This patch renames null_or_bond to orig_or_bond
and initializes it to orig_dev. This keeps the intent of
null_or_bond to pass frames received on VLAN interfaces stacked
on bonding interfaces without invalidating the statement for
null_or_orig.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1845b08c624e..d03470f5260a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2795,7 +2795,7 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
2795 | struct net_device *orig_dev; | 2795 | struct net_device *orig_dev; |
2796 | struct net_device *master; | 2796 | struct net_device *master; |
2797 | struct net_device *null_or_orig; | 2797 | struct net_device *null_or_orig; |
2798 | struct net_device *null_or_bond; | 2798 | struct net_device *orig_or_bond; |
2799 | int ret = NET_RX_DROP; | 2799 | int ret = NET_RX_DROP; |
2800 | __be16 type; | 2800 | __be16 type; |
2801 | 2801 | ||
@@ -2868,10 +2868,10 @@ ncls: | |||
2868 | * device that may have registered for a specific ptype. The | 2868 | * device that may have registered for a specific ptype. The |
2869 | * handler may have to adjust skb->dev and orig_dev. | 2869 | * handler may have to adjust skb->dev and orig_dev. |
2870 | */ | 2870 | */ |
2871 | null_or_bond = NULL; | 2871 | orig_or_bond = orig_dev; |
2872 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && | 2872 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && |
2873 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { | 2873 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { |
2874 | null_or_bond = vlan_dev_real_dev(skb->dev); | 2874 | orig_or_bond = vlan_dev_real_dev(skb->dev); |
2875 | } | 2875 | } |
2876 | 2876 | ||
2877 | type = skb->protocol; | 2877 | type = skb->protocol; |
@@ -2879,7 +2879,7 @@ ncls: | |||
2879 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { | 2879 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { |
2880 | if (ptype->type == type && (ptype->dev == null_or_orig || | 2880 | if (ptype->type == type && (ptype->dev == null_or_orig || |
2881 | ptype->dev == skb->dev || ptype->dev == orig_dev || | 2881 | ptype->dev == skb->dev || ptype->dev == orig_dev || |
2882 | ptype->dev == null_or_bond)) { | 2882 | ptype->dev == orig_or_bond)) { |
2883 | if (pt_prev) | 2883 | if (pt_prev) |
2884 | ret = deliver_skb(skb, pt_prev, orig_dev); | 2884 | ret = deliver_skb(skb, pt_prev, orig_dev); |
2885 | pt_prev = ptype; | 2885 | pt_prev = ptype; |