diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-21 01:47:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:10 -0400 |
commit | eddc9ec53be2ecdbf4efe0efd4a83052594f0ac0 (patch) | |
tree | 4a38ab4dbd9d61fdf5a5ea6ed61463e0b9e33ba7 /drivers/net/bonding | |
parent | e023dd643798c4f06c16466af90b4d250e4b8bd7 (diff) |
[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 17 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
2 files changed, 11 insertions, 8 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) { |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e4724d874e7c..7f11388893fc 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3476,7 +3476,7 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb, | |||
3476 | struct net_device *bond_dev, int count) | 3476 | struct net_device *bond_dev, int count) |
3477 | { | 3477 | { |
3478 | struct ethhdr *data = (struct ethhdr *)skb->data; | 3478 | struct ethhdr *data = (struct ethhdr *)skb->data; |
3479 | struct iphdr *iph = skb->nh.iph; | 3479 | struct iphdr *iph = ip_hdr(skb); |
3480 | u16 *layer4hdr = (u16 *)((u32 *)iph + iph->ihl); | 3480 | u16 *layer4hdr = (u16 *)((u32 *)iph + iph->ihl); |
3481 | int layer4_xor = 0; | 3481 | int layer4_xor = 0; |
3482 | 3482 | ||