mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
194dbcc8a1
commit
2df4a0fa15
|
@ -2795,7 +2795,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
|
||||||
struct net_device *orig_dev;
|
struct net_device *orig_dev;
|
||||||
struct net_device *master;
|
struct net_device *master;
|
||||||
struct net_device *null_or_orig;
|
struct net_device *null_or_orig;
|
||||||
struct net_device *null_or_bond;
|
struct net_device *orig_or_bond;
|
||||||
int ret = NET_RX_DROP;
|
int ret = NET_RX_DROP;
|
||||||
__be16 type;
|
__be16 type;
|
||||||
|
|
||||||
|
@ -2868,10 +2868,10 @@ static int __netif_receive_skb(struct sk_buff *skb)
|
||||||
* device that may have registered for a specific ptype. The
|
* device that may have registered for a specific ptype. The
|
||||||
* handler may have to adjust skb->dev and orig_dev.
|
* handler may have to adjust skb->dev and orig_dev.
|
||||||
*/
|
*/
|
||||||
null_or_bond = NULL;
|
orig_or_bond = orig_dev;
|
||||||
if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
|
if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
|
||||||
(vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
|
(vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
|
||||||
null_or_bond = vlan_dev_real_dev(skb->dev);
|
orig_or_bond = vlan_dev_real_dev(skb->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
type = skb->protocol;
|
type = skb->protocol;
|
||||||
|
@ -2879,7 +2879,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
|
||||||
&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
|
&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
|
||||||
if (ptype->type == type && (ptype->dev == null_or_orig ||
|
if (ptype->type == type && (ptype->dev == null_or_orig ||
|
||||||
ptype->dev == skb->dev || ptype->dev == orig_dev ||
|
ptype->dev == skb->dev || ptype->dev == orig_dev ||
|
||||||
ptype->dev == null_or_bond)) {
|
ptype->dev == orig_or_bond)) {
|
||||||
if (pt_prev)
|
if (pt_prev)
|
||||||
ret = deliver_skb(skb, pt_prev, orig_dev);
|
ret = deliver_skb(skb, pt_prev, orig_dev);
|
||||||
pt_prev = ptype;
|
pt_prev = ptype;
|
||||||
|
|
Loading…
Reference in New Issue