diff options
Diffstat (limited to 'drivers/net/bonding/bond_alb.c')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 86cfcb3f8131..8555afa574a4 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -112,7 +112,7 @@ static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb) | |||
112 | /* Forward declaration */ | 112 | /* Forward declaration */ |
113 | static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]); | 113 | static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]); |
114 | 114 | ||
115 | static inline u8 _simple_hash(u8 *hash_start, int hash_size) | 115 | static inline u8 _simple_hash(const u8 *hash_start, int hash_size) |
116 | { | 116 | { |
117 | int i; | 117 | int i; |
118 | u8 hash = 0; | 118 | u8 hash = 0; |
@@ -1268,7 +1268,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1268 | int hash_size = 0; | 1268 | int hash_size = 0; |
1269 | int do_tx_balance = 1; | 1269 | int do_tx_balance = 1; |
1270 | u32 hash_index = 0; | 1270 | u32 hash_index = 0; |
1271 | u8 *hash_start = NULL; | 1271 | const u8 *hash_start = NULL; |
1272 | int res = 1; | 1272 | int res = 1; |
1273 | 1273 | ||
1274 | skb_reset_mac_header(skb); | 1274 | skb_reset_mac_header(skb); |
@@ -1285,15 +1285,18 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | switch (ntohs(skb->protocol)) { | 1287 | switch (ntohs(skb->protocol)) { |
1288 | case ETH_P_IP: | 1288 | case ETH_P_IP: { |
1289 | const struct iphdr *iph = ip_hdr(skb); | ||
1290 | |||
1289 | if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) || | 1291 | if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) || |
1290 | (skb->nh.iph->daddr == ip_bcast) || | 1292 | (iph->daddr == ip_bcast) || |
1291 | (skb->nh.iph->protocol == IPPROTO_IGMP)) { | 1293 | (iph->protocol == IPPROTO_IGMP)) { |
1292 | do_tx_balance = 0; | 1294 | do_tx_balance = 0; |
1293 | break; | 1295 | break; |
1294 | } | 1296 | } |
1295 | hash_start = (char*)&(skb->nh.iph->daddr); | 1297 | hash_start = (char *)&(iph->daddr); |
1296 | hash_size = sizeof(skb->nh.iph->daddr); | 1298 | hash_size = sizeof(iph->daddr); |
1299 | } | ||
1297 | break; | 1300 | break; |
1298 | case ETH_P_IPV6: | 1301 | case ETH_P_IPV6: |
1299 | if (memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) { | 1302 | if (memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) { |