diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index f9aa699ab6cb..d9ab9be0c323 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2430,6 +2430,7 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2430 | struct packet_type *ptype, *pt_prev; | 2430 | struct packet_type *ptype, *pt_prev; |
2431 | struct net_device *orig_dev; | 2431 | struct net_device *orig_dev; |
2432 | struct net_device *null_or_orig; | 2432 | struct net_device *null_or_orig; |
2433 | struct net_device *null_or_bond; | ||
2433 | int ret = NET_RX_DROP; | 2434 | int ret = NET_RX_DROP; |
2434 | __be16 type; | 2435 | __be16 type; |
2435 | 2436 | ||
@@ -2500,21 +2501,19 @@ ncls: | |||
2500 | * bonding interfaces still make their way to any base bonding | 2501 | * bonding interfaces still make their way to any base bonding |
2501 | * device that may have registered for a specific ptype. The | 2502 | * device that may have registered for a specific ptype. The |
2502 | * handler may have to adjust skb->dev and orig_dev. | 2503 | * handler may have to adjust skb->dev and orig_dev. |
2503 | * | ||
2504 | * null_or_orig can be overloaded since it will not be set when | ||
2505 | * using VLANs on top of bonding. Putting it here prevents | ||
2506 | * disturbing the ptype_all handlers above. | ||
2507 | */ | 2504 | */ |
2505 | null_or_bond = NULL; | ||
2508 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && | 2506 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && |
2509 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { | 2507 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { |
2510 | null_or_orig = vlan_dev_real_dev(skb->dev); | 2508 | null_or_bond = vlan_dev_real_dev(skb->dev); |
2511 | } | 2509 | } |
2512 | 2510 | ||
2513 | type = skb->protocol; | 2511 | type = skb->protocol; |
2514 | list_for_each_entry_rcu(ptype, | 2512 | list_for_each_entry_rcu(ptype, |
2515 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { | 2513 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { |
2516 | if (ptype->type == type && (ptype->dev == null_or_orig || | 2514 | if (ptype->type == type && (ptype->dev == null_or_orig || |
2517 | ptype->dev == skb->dev || ptype->dev == orig_dev)) { | 2515 | ptype->dev == skb->dev || ptype->dev == orig_dev || |
2516 | ptype->dev == null_or_bond)) { | ||
2518 | if (pt_prev) | 2517 | if (pt_prev) |
2519 | ret = deliver_skb(skb, pt_prev, orig_dev); | 2518 | ret = deliver_skb(skb, pt_prev, orig_dev); |
2520 | pt_prev = ptype; | 2519 | pt_prev = ptype; |