diff options
-rw-r--r-- | include/linux/netdevice.h | 8 | ||||
-rw-r--r-- | net/8021q/vlan_core.c | 4 | ||||
-rw-r--r-- | net/core/dev.c | 8 |
3 files changed, 11 insertions, 9 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c79a88be7c33..fa8b47637997 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2059,12 +2059,12 @@ static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, | |||
2059 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 2059 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
2060 | * ARP on active-backup slaves with arp_validate enabled. | 2060 | * ARP on active-backup slaves with arp_validate enabled. |
2061 | */ | 2061 | */ |
2062 | static inline int skb_bond_should_drop(struct sk_buff *skb) | 2062 | static inline int skb_bond_should_drop(struct sk_buff *skb, |
2063 | struct net_device *master) | ||
2063 | { | 2064 | { |
2064 | struct net_device *dev = skb->dev; | ||
2065 | struct net_device *master = dev->master; | ||
2066 | |||
2067 | if (master) { | 2065 | if (master) { |
2066 | struct net_device *dev = skb->dev; | ||
2067 | |||
2068 | if (master->priv_flags & IFF_MASTER_ARPMON) | 2068 | if (master->priv_flags & IFF_MASTER_ARPMON) |
2069 | dev->last_rx = jiffies; | 2069 | dev->last_rx = jiffies; |
2070 | 2070 | ||
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index c0316e0ca6e8..c584a0af77d3 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
11 | if (netpoll_rx(skb)) | 11 | if (netpoll_rx(skb)) |
12 | return NET_RX_DROP; | 12 | return NET_RX_DROP; |
13 | 13 | ||
14 | if (skb_bond_should_drop(skb)) | 14 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
15 | goto drop; | 15 | goto drop; |
16 | 16 | ||
17 | skb->skb_iif = skb->dev->ifindex; | 17 | skb->skb_iif = skb->dev->ifindex; |
@@ -83,7 +83,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | |||
83 | { | 83 | { |
84 | struct sk_buff *p; | 84 | struct sk_buff *p; |
85 | 85 | ||
86 | if (skb_bond_should_drop(skb)) | 86 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
87 | goto drop; | 87 | goto drop; |
88 | 88 | ||
89 | skb->skb_iif = skb->dev->ifindex; | 89 | skb->skb_iif = skb->dev->ifindex; |
diff --git a/net/core/dev.c b/net/core/dev.c index bcc490cc9452..59d4394d2ce8 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2483,6 +2483,7 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2483 | { | 2483 | { |
2484 | struct packet_type *ptype, *pt_prev; | 2484 | struct packet_type *ptype, *pt_prev; |
2485 | struct net_device *orig_dev; | 2485 | struct net_device *orig_dev; |
2486 | struct net_device *master; | ||
2486 | struct net_device *null_or_orig; | 2487 | struct net_device *null_or_orig; |
2487 | struct net_device *null_or_bond; | 2488 | struct net_device *null_or_bond; |
2488 | int ret = NET_RX_DROP; | 2489 | int ret = NET_RX_DROP; |
@@ -2503,11 +2504,12 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2503 | 2504 | ||
2504 | null_or_orig = NULL; | 2505 | null_or_orig = NULL; |
2505 | orig_dev = skb->dev; | 2506 | orig_dev = skb->dev; |
2506 | if (orig_dev->master) { | 2507 | master = ACCESS_ONCE(orig_dev->master); |
2507 | if (skb_bond_should_drop(skb)) | 2508 | if (master) { |
2509 | if (skb_bond_should_drop(skb, master)) | ||
2508 | null_or_orig = orig_dev; /* deliver only exact match */ | 2510 | null_or_orig = orig_dev; /* deliver only exact match */ |
2509 | else | 2511 | else |
2510 | skb->dev = orig_dev->master; | 2512 | skb->dev = master; |
2511 | } | 2513 | } |
2512 | 2514 | ||
2513 | __get_cpu_var(netdev_rx_stat).total++; | 2515 | __get_cpu_var(netdev_rx_stat).total++; |