diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-08-22 20:06:58 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:56 -0400 |
commit | d3bb52b0948cf118131c951c5a34a2d4d0246171 (patch) | |
tree | e06f2029134bd0f6fae3cc99107191b55ef30ea4 /drivers/net/bonding/bond_main.c | |
parent | dd96df2cc2539ecd451614a2ffed4d8a4c541d92 (diff) |
endianness annotations drivers/net/bonding/
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 8f77db2112ce..64bfec32e2a6 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -144,7 +144,7 @@ static struct proc_dir_entry *bond_proc_dir = NULL; | |||
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | extern struct rw_semaphore bonding_rwsem; | 146 | extern struct rw_semaphore bonding_rwsem; |
147 | static u32 arp_target[BOND_MAX_ARP_TARGETS] = { 0, } ; | 147 | static __be32 arp_target[BOND_MAX_ARP_TARGETS] = { 0, } ; |
148 | static int arp_ip_count = 0; | 148 | static int arp_ip_count = 0; |
149 | static int bond_mode = BOND_MODE_ROUNDROBIN; | 149 | static int bond_mode = BOND_MODE_ROUNDROBIN; |
150 | static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2; | 150 | static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2; |
@@ -2226,7 +2226,7 @@ out: | |||
2226 | } | 2226 | } |
2227 | 2227 | ||
2228 | 2228 | ||
2229 | static u32 bond_glean_dev_ip(struct net_device *dev) | 2229 | static __be32 bond_glean_dev_ip(struct net_device *dev) |
2230 | { | 2230 | { |
2231 | struct in_device *idev; | 2231 | struct in_device *idev; |
2232 | struct in_ifaddr *ifa; | 2232 | struct in_ifaddr *ifa; |
@@ -2269,7 +2269,7 @@ static int bond_has_ip(struct bonding *bond) | |||
2269 | return 0; | 2269 | return 0; |
2270 | } | 2270 | } |
2271 | 2271 | ||
2272 | static int bond_has_this_ip(struct bonding *bond, u32 ip) | 2272 | static int bond_has_this_ip(struct bonding *bond, __be32 ip) |
2273 | { | 2273 | { |
2274 | struct vlan_entry *vlan, *vlan_next; | 2274 | struct vlan_entry *vlan, *vlan_next; |
2275 | 2275 | ||
@@ -2293,7 +2293,7 @@ static int bond_has_this_ip(struct bonding *bond, u32 ip) | |||
2293 | * switches in VLAN mode (especially if ports are configured as | 2293 | * switches in VLAN mode (especially if ports are configured as |
2294 | * "native" to a VLAN) might not pass non-tagged frames. | 2294 | * "native" to a VLAN) might not pass non-tagged frames. |
2295 | */ | 2295 | */ |
2296 | static void bond_arp_send(struct net_device *slave_dev, int arp_op, u32 dest_ip, u32 src_ip, unsigned short vlan_id) | 2296 | static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_ip, __be32 src_ip, unsigned short vlan_id) |
2297 | { | 2297 | { |
2298 | struct sk_buff *skb; | 2298 | struct sk_buff *skb; |
2299 | 2299 | ||
@@ -2321,7 +2321,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, u32 dest_ip, | |||
2321 | static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | 2321 | static void bond_arp_send_all(struct bonding *bond, struct slave *slave) |
2322 | { | 2322 | { |
2323 | int i, vlan_id, rv; | 2323 | int i, vlan_id, rv; |
2324 | u32 *targets = bond->params.arp_targets; | 2324 | __be32 *targets = bond->params.arp_targets; |
2325 | struct vlan_entry *vlan, *vlan_next; | 2325 | struct vlan_entry *vlan, *vlan_next; |
2326 | struct net_device *vlan_dev; | 2326 | struct net_device *vlan_dev; |
2327 | struct flowi fl; | 2327 | struct flowi fl; |
@@ -2426,10 +2426,10 @@ static void bond_send_gratuitous_arp(struct bonding *bond) | |||
2426 | } | 2426 | } |
2427 | } | 2427 | } |
2428 | 2428 | ||
2429 | static void bond_validate_arp(struct bonding *bond, struct slave *slave, u32 sip, u32 tip) | 2429 | static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 sip, __be32 tip) |
2430 | { | 2430 | { |
2431 | int i; | 2431 | int i; |
2432 | u32 *targets = bond->params.arp_targets; | 2432 | __be32 *targets = bond->params.arp_targets; |
2433 | 2433 | ||
2434 | targets = bond->params.arp_targets; | 2434 | targets = bond->params.arp_targets; |
2435 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { | 2435 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { |
@@ -2451,7 +2451,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack | |||
2451 | struct slave *slave; | 2451 | struct slave *slave; |
2452 | struct bonding *bond; | 2452 | struct bonding *bond; |
2453 | unsigned char *arp_ptr; | 2453 | unsigned char *arp_ptr; |
2454 | u32 sip, tip; | 2454 | __be32 sip, tip; |
2455 | 2455 | ||
2456 | if (dev->nd_net != &init_net) | 2456 | if (dev->nd_net != &init_net) |
2457 | goto out; | 2457 | goto out; |
@@ -3427,14 +3427,14 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb, | |||
3427 | { | 3427 | { |
3428 | struct ethhdr *data = (struct ethhdr *)skb->data; | 3428 | struct ethhdr *data = (struct ethhdr *)skb->data; |
3429 | struct iphdr *iph = ip_hdr(skb); | 3429 | struct iphdr *iph = ip_hdr(skb); |
3430 | u16 *layer4hdr = (u16 *)((u32 *)iph + iph->ihl); | 3430 | __be16 *layer4hdr = (__be16 *)((u32 *)iph + iph->ihl); |
3431 | int layer4_xor = 0; | 3431 | int layer4_xor = 0; |
3432 | 3432 | ||
3433 | if (skb->protocol == __constant_htons(ETH_P_IP)) { | 3433 | if (skb->protocol == __constant_htons(ETH_P_IP)) { |
3434 | if (!(iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) && | 3434 | if (!(iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) && |
3435 | (iph->protocol == IPPROTO_TCP || | 3435 | (iph->protocol == IPPROTO_TCP || |
3436 | iph->protocol == IPPROTO_UDP)) { | 3436 | iph->protocol == IPPROTO_UDP)) { |
3437 | layer4_xor = htons((*layer4hdr ^ *(layer4hdr + 1))); | 3437 | layer4_xor = ntohs((*layer4hdr ^ *(layer4hdr + 1))); |
3438 | } | 3438 | } |
3439 | return (layer4_xor ^ | 3439 | return (layer4_xor ^ |
3440 | ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count; | 3440 | ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count; |
@@ -4521,7 +4521,7 @@ static int bond_check_params(struct bond_params *params) | |||
4521 | arp_ip_target[arp_ip_count]); | 4521 | arp_ip_target[arp_ip_count]); |
4522 | arp_interval = 0; | 4522 | arp_interval = 0; |
4523 | } else { | 4523 | } else { |
4524 | u32 ip = in_aton(arp_ip_target[arp_ip_count]); | 4524 | __be32 ip = in_aton(arp_ip_target[arp_ip_count]); |
4525 | arp_target[arp_ip_count] = ip; | 4525 | arp_target[arp_ip_count] = ip; |
4526 | } | 4526 | } |
4527 | } | 4527 | } |