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 | |
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>
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 42 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.h | 20 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 19 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.h | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 22 | ||||
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 8 | ||||
-rw-r--r-- | drivers/net/bonding/bonding.h | 6 |
7 files changed, 48 insertions, 73 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 94bd73941451..7a045a37056e 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -101,7 +101,6 @@ static u16 __get_link_speed(struct port *port); | |||
101 | static u8 __get_duplex(struct port *port); | 101 | static u8 __get_duplex(struct port *port); |
102 | static inline void __initialize_port_locks(struct port *port); | 102 | static inline void __initialize_port_locks(struct port *port); |
103 | //conversions | 103 | //conversions |
104 | static void __htons_lacpdu(struct lacpdu *lacpdu); | ||
105 | static u16 __ad_timer_to_ticks(u16 timer_type, u16 Par); | 104 | static u16 __ad_timer_to_ticks(u16 timer_type, u16 Par); |
106 | 105 | ||
107 | 106 | ||
@@ -420,26 +419,6 @@ static inline void __initialize_port_locks(struct port *port) | |||
420 | } | 419 | } |
421 | 420 | ||
422 | //conversions | 421 | //conversions |
423 | /** | ||
424 | * __htons_lacpdu - convert the contents of a LACPDU to network byte order | ||
425 | * @lacpdu: the speicifed lacpdu | ||
426 | * | ||
427 | * For each multi-byte field in the lacpdu, convert its content | ||
428 | */ | ||
429 | static void __htons_lacpdu(struct lacpdu *lacpdu) | ||
430 | { | ||
431 | if (lacpdu) { | ||
432 | lacpdu->actor_system_priority = htons(lacpdu->actor_system_priority); | ||
433 | lacpdu->actor_key = htons(lacpdu->actor_key); | ||
434 | lacpdu->actor_port_priority = htons(lacpdu->actor_port_priority); | ||
435 | lacpdu->actor_port = htons(lacpdu->actor_port); | ||
436 | lacpdu->partner_system_priority = htons(lacpdu->partner_system_priority); | ||
437 | lacpdu->partner_key = htons(lacpdu->partner_key); | ||
438 | lacpdu->partner_port_priority = htons(lacpdu->partner_port_priority); | ||
439 | lacpdu->partner_port = htons(lacpdu->partner_port); | ||
440 | lacpdu->collector_max_delay = htons(lacpdu->collector_max_delay); | ||
441 | } | ||
442 | } | ||
443 | 422 | ||
444 | /** | 423 | /** |
445 | * __ad_timer_to_ticks - convert a given timer type to AD module ticks | 424 | * __ad_timer_to_ticks - convert a given timer type to AD module ticks |
@@ -827,11 +806,11 @@ static inline void __update_lacpdu_from_port(struct port *port) | |||
827 | * lacpdu->actor_information_length initialized | 806 | * lacpdu->actor_information_length initialized |
828 | */ | 807 | */ |
829 | 808 | ||
830 | lacpdu->actor_system_priority = port->actor_system_priority; | 809 | lacpdu->actor_system_priority = htons(port->actor_system_priority); |
831 | lacpdu->actor_system = port->actor_system; | 810 | lacpdu->actor_system = port->actor_system; |
832 | lacpdu->actor_key = port->actor_oper_port_key; | 811 | lacpdu->actor_key = htons(port->actor_oper_port_key); |
833 | lacpdu->actor_port_priority = port->actor_port_priority; | 812 | lacpdu->actor_port_priority = htons(port->actor_port_priority); |
834 | lacpdu->actor_port = port->actor_port_number; | 813 | lacpdu->actor_port = htons(port->actor_port_number); |
835 | lacpdu->actor_state = port->actor_oper_port_state; | 814 | lacpdu->actor_state = port->actor_oper_port_state; |
836 | 815 | ||
837 | /* lacpdu->reserved_3_1 initialized | 816 | /* lacpdu->reserved_3_1 initialized |
@@ -839,11 +818,11 @@ static inline void __update_lacpdu_from_port(struct port *port) | |||
839 | * lacpdu->partner_information_length initialized | 818 | * lacpdu->partner_information_length initialized |
840 | */ | 819 | */ |
841 | 820 | ||
842 | lacpdu->partner_system_priority = port->partner_oper_system_priority; | 821 | lacpdu->partner_system_priority = htons(port->partner_oper_system_priority); |
843 | lacpdu->partner_system = port->partner_oper_system; | 822 | lacpdu->partner_system = port->partner_oper_system; |
844 | lacpdu->partner_key = port->partner_oper_key; | 823 | lacpdu->partner_key = htons(port->partner_oper_key); |
845 | lacpdu->partner_port_priority = port->partner_oper_port_priority; | 824 | lacpdu->partner_port_priority = htons(port->partner_oper_port_priority); |
846 | lacpdu->partner_port = port->partner_oper_port_number; | 825 | lacpdu->partner_port = htons(port->partner_oper_port_number); |
847 | lacpdu->partner_state = port->partner_oper_port_state; | 826 | lacpdu->partner_state = port->partner_oper_port_state; |
848 | 827 | ||
849 | /* lacpdu->reserved_3_2 initialized | 828 | /* lacpdu->reserved_3_2 initialized |
@@ -855,9 +834,6 @@ static inline void __update_lacpdu_from_port(struct port *port) | |||
855 | * terminator_length initialized | 834 | * terminator_length initialized |
856 | * reserved_50[50] initialized | 835 | * reserved_50[50] initialized |
857 | */ | 836 | */ |
858 | |||
859 | /* Convert all non u8 parameters to Big Endian for transmit */ | ||
860 | __htons_lacpdu(lacpdu); | ||
861 | } | 837 | } |
862 | 838 | ||
863 | ////////////////////////////////////////////////////////////////////////////////////// | 839 | ////////////////////////////////////////////////////////////////////////////////////// |
@@ -1834,7 +1810,7 @@ static void ad_initialize_lacpdu(struct lacpdu *lacpdu) | |||
1834 | } | 1810 | } |
1835 | lacpdu->tlv_type_collector_info = 0x03; | 1811 | lacpdu->tlv_type_collector_info = 0x03; |
1836 | lacpdu->collector_information_length= 0x10; | 1812 | lacpdu->collector_information_length= 0x10; |
1837 | lacpdu->collector_max_delay = AD_COLLECTOR_MAX_DELAY; | 1813 | lacpdu->collector_max_delay = htons(AD_COLLECTOR_MAX_DELAY); |
1838 | for (index=0; index<=11; index++) { | 1814 | for (index=0; index<=11; index++) { |
1839 | lacpdu->reserved_12[index]=0; | 1815 | lacpdu->reserved_12[index]=0; |
1840 | } | 1816 | } |
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 6ad5ad6e65d5..862952fa6fd9 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
@@ -108,7 +108,7 @@ typedef enum { | |||
108 | typedef struct ad_header { | 108 | typedef struct ad_header { |
109 | struct mac_addr destination_address; | 109 | struct mac_addr destination_address; |
110 | struct mac_addr source_address; | 110 | struct mac_addr source_address; |
111 | u16 length_type; | 111 | __be16 length_type; |
112 | } ad_header_t; | 112 | } ad_header_t; |
113 | 113 | ||
114 | // Link Aggregation Control Protocol(LACP) data unit structure(43.4.2.2 in the 802.3ad standard) | 114 | // Link Aggregation Control Protocol(LACP) data unit structure(43.4.2.2 in the 802.3ad standard) |
@@ -117,25 +117,25 @@ typedef struct lacpdu { | |||
117 | u8 version_number; | 117 | u8 version_number; |
118 | u8 tlv_type_actor_info; // = actor information(type/length/value) | 118 | u8 tlv_type_actor_info; // = actor information(type/length/value) |
119 | u8 actor_information_length; // = 20 | 119 | u8 actor_information_length; // = 20 |
120 | u16 actor_system_priority; | 120 | __be16 actor_system_priority; |
121 | struct mac_addr actor_system; | 121 | struct mac_addr actor_system; |
122 | u16 actor_key; | 122 | __be16 actor_key; |
123 | u16 actor_port_priority; | 123 | __be16 actor_port_priority; |
124 | u16 actor_port; | 124 | __be16 actor_port; |
125 | u8 actor_state; | 125 | u8 actor_state; |
126 | u8 reserved_3_1[3]; // = 0 | 126 | u8 reserved_3_1[3]; // = 0 |
127 | u8 tlv_type_partner_info; // = partner information | 127 | u8 tlv_type_partner_info; // = partner information |
128 | u8 partner_information_length; // = 20 | 128 | u8 partner_information_length; // = 20 |
129 | u16 partner_system_priority; | 129 | __be16 partner_system_priority; |
130 | struct mac_addr partner_system; | 130 | struct mac_addr partner_system; |
131 | u16 partner_key; | 131 | __be16 partner_key; |
132 | u16 partner_port_priority; | 132 | __be16 partner_port_priority; |
133 | u16 partner_port; | 133 | __be16 partner_port; |
134 | u8 partner_state; | 134 | u8 partner_state; |
135 | u8 reserved_3_2[3]; // = 0 | 135 | u8 reserved_3_2[3]; // = 0 |
136 | u8 tlv_type_collector_info; // = collector information | 136 | u8 tlv_type_collector_info; // = collector information |
137 | u8 collector_information_length; // = 16 | 137 | u8 collector_information_length; // = 16 |
138 | u16 collector_max_delay; | 138 | __be16 collector_max_delay; |
139 | u8 reserved_12[12]; | 139 | u8 reserved_12[12]; |
140 | u8 tlv_type_terminator; // = terminator | 140 | u8 tlv_type_terminator; // = terminator |
141 | u8 terminator_length; // = 0 | 141 | u8 terminator_length; // = 0 |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 419a9f8fdd53..aea2217c56eb 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -87,20 +87,20 @@ static const int alb_delta_in_ticks = HZ / ALB_TIMER_TICKS_PER_SEC; | |||
87 | struct learning_pkt { | 87 | struct learning_pkt { |
88 | u8 mac_dst[ETH_ALEN]; | 88 | u8 mac_dst[ETH_ALEN]; |
89 | u8 mac_src[ETH_ALEN]; | 89 | u8 mac_src[ETH_ALEN]; |
90 | u16 type; | 90 | __be16 type; |
91 | u8 padding[ETH_ZLEN - ETH_HLEN]; | 91 | u8 padding[ETH_ZLEN - ETH_HLEN]; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | struct arp_pkt { | 94 | struct arp_pkt { |
95 | u16 hw_addr_space; | 95 | __be16 hw_addr_space; |
96 | u16 prot_addr_space; | 96 | __be16 prot_addr_space; |
97 | u8 hw_addr_len; | 97 | u8 hw_addr_len; |
98 | u8 prot_addr_len; | 98 | u8 prot_addr_len; |
99 | u16 op_code; | 99 | __be16 op_code; |
100 | u8 mac_src[ETH_ALEN]; /* sender hardware address */ | 100 | u8 mac_src[ETH_ALEN]; /* sender hardware address */ |
101 | u32 ip_src; /* sender IP address */ | 101 | __be32 ip_src; /* sender IP address */ |
102 | u8 mac_dst[ETH_ALEN]; /* target hardware address */ | 102 | u8 mac_dst[ETH_ALEN]; /* target hardware address */ |
103 | u32 ip_dst; /* target IP address */ | 103 | __be32 ip_dst; /* target IP address */ |
104 | }; | 104 | }; |
105 | #pragma pack() | 105 | #pragma pack() |
106 | 106 | ||
@@ -582,7 +582,7 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla | |||
582 | } | 582 | } |
583 | 583 | ||
584 | /* mark all clients using src_ip to be updated */ | 584 | /* mark all clients using src_ip to be updated */ |
585 | static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) | 585 | static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) |
586 | { | 586 | { |
587 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); | 587 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); |
588 | struct rlb_client_info *client_info; | 588 | struct rlb_client_info *client_info; |
@@ -1267,7 +1267,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1267 | struct ethhdr *eth_data; | 1267 | struct ethhdr *eth_data; |
1268 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); | 1268 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); |
1269 | struct slave *tx_slave = NULL; | 1269 | struct slave *tx_slave = NULL; |
1270 | static const u32 ip_bcast = 0xffffffff; | 1270 | static const __be32 ip_bcast = htonl(0xffffffff); |
1271 | int hash_size = 0; | 1271 | int hash_size = 0; |
1272 | int do_tx_balance = 1; | 1272 | int do_tx_balance = 1; |
1273 | u32 hash_index = 0; | 1273 | u32 hash_index = 0; |
@@ -1311,8 +1311,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1311 | hash_size = sizeof(ipv6_hdr(skb)->daddr); | 1311 | hash_size = sizeof(ipv6_hdr(skb)->daddr); |
1312 | break; | 1312 | break; |
1313 | case ETH_P_IPX: | 1313 | case ETH_P_IPX: |
1314 | if (ipx_hdr(skb)->ipx_checksum != | 1314 | if (ipx_hdr(skb)->ipx_checksum != IPX_NO_CHECKSUM) { |
1315 | __constant_htons(IPX_NO_CHECKSUM)) { | ||
1316 | /* something is wrong with this packet */ | 1315 | /* something is wrong with this packet */ |
1317 | do_tx_balance = 0; | 1316 | do_tx_balance = 0; |
1318 | break; | 1317 | break; |
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h index 28f2a2fd1b5a..fd8726429890 100644 --- a/drivers/net/bonding/bond_alb.h +++ b/drivers/net/bonding/bond_alb.h | |||
@@ -60,8 +60,8 @@ struct tlb_client_info { | |||
60 | * ------------------------------------------------------------------------- | 60 | * ------------------------------------------------------------------------- |
61 | */ | 61 | */ |
62 | struct rlb_client_info { | 62 | struct rlb_client_info { |
63 | u32 ip_src; /* the server IP address */ | 63 | __be32 ip_src; /* the server IP address */ |
64 | u32 ip_dst; /* the client IP address */ | 64 | __be32 ip_dst; /* the client IP address */ |
65 | u8 mac_dst[ETH_ALEN]; /* the client MAC address */ | 65 | u8 mac_dst[ETH_ALEN]; /* the client MAC address */ |
66 | u32 next; /* The next Hash table entry index */ | 66 | u32 next; /* The next Hash table entry index */ |
67 | u32 prev; /* The previous Hash table entry index */ | 67 | u32 prev; /* The previous Hash table entry index */ |
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 | } |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index f10927639b5c..6f49ca7e9b66 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -682,16 +682,16 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
682 | struct device_attribute *attr, | 682 | struct device_attribute *attr, |
683 | const char *buf, size_t count) | 683 | const char *buf, size_t count) |
684 | { | 684 | { |
685 | u32 newtarget; | 685 | __be32 newtarget; |
686 | int i = 0, done = 0, ret = count; | 686 | int i = 0, done = 0, ret = count; |
687 | struct bonding *bond = to_bond(d); | 687 | struct bonding *bond = to_bond(d); |
688 | u32 *targets; | 688 | __be32 *targets; |
689 | 689 | ||
690 | targets = bond->params.arp_targets; | 690 | targets = bond->params.arp_targets; |
691 | newtarget = in_aton(buf + 1); | 691 | newtarget = in_aton(buf + 1); |
692 | /* look for adds */ | 692 | /* look for adds */ |
693 | if (buf[0] == '+') { | 693 | if (buf[0] == '+') { |
694 | if ((newtarget == 0) || (newtarget == INADDR_BROADCAST)) { | 694 | if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { |
695 | printk(KERN_ERR DRV_NAME | 695 | printk(KERN_ERR DRV_NAME |
696 | ": %s: invalid ARP target %u.%u.%u.%u specified for addition\n", | 696 | ": %s: invalid ARP target %u.%u.%u.%u specified for addition\n", |
697 | bond->dev->name, NIPQUAD(newtarget)); | 697 | bond->dev->name, NIPQUAD(newtarget)); |
@@ -727,7 +727,7 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
727 | 727 | ||
728 | } | 728 | } |
729 | else if (buf[0] == '-') { | 729 | else if (buf[0] == '-') { |
730 | if ((newtarget == 0) || (newtarget == INADDR_BROADCAST)) { | 730 | if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { |
731 | printk(KERN_ERR DRV_NAME | 731 | printk(KERN_ERR DRV_NAME |
732 | ": %s: invalid ARP target %d.%d.%d.%d specified for removal\n", | 732 | ": %s: invalid ARP target %d.%d.%d.%d specified for removal\n", |
733 | bond->dev->name, NIPQUAD(newtarget)); | 733 | bond->dev->name, NIPQUAD(newtarget)); |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 6dcbd25e3ef0..2a6af7d23728 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -132,7 +132,7 @@ struct bond_params { | |||
132 | int downdelay; | 132 | int downdelay; |
133 | int lacp_fast; | 133 | int lacp_fast; |
134 | char primary[IFNAMSIZ]; | 134 | char primary[IFNAMSIZ]; |
135 | u32 arp_targets[BOND_MAX_ARP_TARGETS]; | 135 | __be32 arp_targets[BOND_MAX_ARP_TARGETS]; |
136 | }; | 136 | }; |
137 | 137 | ||
138 | struct bond_parm_tbl { | 138 | struct bond_parm_tbl { |
@@ -142,7 +142,7 @@ struct bond_parm_tbl { | |||
142 | 142 | ||
143 | struct vlan_entry { | 143 | struct vlan_entry { |
144 | struct list_head vlan_list; | 144 | struct list_head vlan_list; |
145 | u32 vlan_ip; | 145 | __be32 vlan_ip; |
146 | unsigned short vlan_id; | 146 | unsigned short vlan_id; |
147 | }; | 147 | }; |
148 | 148 | ||
@@ -193,7 +193,7 @@ struct bonding { | |||
193 | struct list_head bond_list; | 193 | struct list_head bond_list; |
194 | struct dev_mc_list *mc_list; | 194 | struct dev_mc_list *mc_list; |
195 | int (*xmit_hash_policy)(struct sk_buff *, struct net_device *, int); | 195 | int (*xmit_hash_policy)(struct sk_buff *, struct net_device *, int); |
196 | u32 master_ip; | 196 | __be32 master_ip; |
197 | u16 flags; | 197 | u16 flags; |
198 | struct ad_bond_info ad_info; | 198 | struct ad_bond_info ad_info; |
199 | struct alb_bond_info alb_info; | 199 | struct alb_bond_info alb_info; |