diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d1a21b576a40..470f7c951afb 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2089,54 +2089,14 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
2089 | dev->gso_max_size = size; | 2089 | dev->gso_max_size = size; |
2090 | } | 2090 | } |
2091 | 2091 | ||
2092 | static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, | 2092 | extern int __skb_bond_should_drop(struct sk_buff *skb, |
2093 | struct net_device *master) | 2093 | struct net_device *master); |
2094 | { | ||
2095 | if (skb->pkt_type == PACKET_HOST) { | ||
2096 | u16 *dest = (u16 *) eth_hdr(skb)->h_dest; | ||
2097 | |||
2098 | memcpy(dest, master->dev_addr, ETH_ALEN); | ||
2099 | } | ||
2100 | } | ||
2101 | 2094 | ||
2102 | /* On bonding slaves other than the currently active slave, suppress | ||
2103 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | ||
2104 | * ARP on active-backup slaves with arp_validate enabled. | ||
2105 | */ | ||
2106 | static inline int skb_bond_should_drop(struct sk_buff *skb, | 2095 | static inline int skb_bond_should_drop(struct sk_buff *skb, |
2107 | struct net_device *master) | 2096 | struct net_device *master) |
2108 | { | 2097 | { |
2109 | if (master) { | 2098 | if (master) |
2110 | struct net_device *dev = skb->dev; | 2099 | return __skb_bond_should_drop(skb, master); |
2111 | |||
2112 | if (master->priv_flags & IFF_MASTER_ARPMON) | ||
2113 | dev->last_rx = jiffies; | ||
2114 | |||
2115 | if ((master->priv_flags & IFF_MASTER_ALB) && master->br_port) { | ||
2116 | /* Do address unmangle. The local destination address | ||
2117 | * will be always the one master has. Provides the right | ||
2118 | * functionality in a bridge. | ||
2119 | */ | ||
2120 | skb_bond_set_mac_by_master(skb, master); | ||
2121 | } | ||
2122 | |||
2123 | if (dev->priv_flags & IFF_SLAVE_INACTIVE) { | ||
2124 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | ||
2125 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) | ||
2126 | return 0; | ||
2127 | |||
2128 | if (master->priv_flags & IFF_MASTER_ALB) { | ||
2129 | if (skb->pkt_type != PACKET_BROADCAST && | ||
2130 | skb->pkt_type != PACKET_MULTICAST) | ||
2131 | return 0; | ||
2132 | } | ||
2133 | if (master->priv_flags & IFF_MASTER_8023AD && | ||
2134 | skb->protocol == __cpu_to_be16(ETH_P_SLOW)) | ||
2135 | return 0; | ||
2136 | |||
2137 | return 1; | ||
2138 | } | ||
2139 | } | ||
2140 | return 0; | 2100 | return 0; |
2141 | } | 2101 | } |
2142 | 2102 | ||