diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-14 23:56:00 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:52 -0500 |
commit | e69a4adc669fe210817ec50ae3f9a7a5ad62d4e8 (patch) | |
tree | de4666cd772f02aac4cbacf11251faeb54e99d1d /net | |
parent | b09b845ca6724c3bbdc00c0cb2313258c7189ca9 (diff) |
[IPV6]: Misc endianness annotations.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/addrconf.c | 2 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 4 | ||||
-rw-r--r-- | net/ipv6/datagram.c | 6 | ||||
-rw-r--r-- | net/ipv6/exthdrs.c | 2 | ||||
-rw-r--r-- | net/ipv6/exthdrs_core.c | 2 | ||||
-rw-r--r-- | net/ipv6/inet6_connection_sock.c | 8 | ||||
-rw-r--r-- | net/ipv6/ip6_fib.c | 8 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv6/mip6.c | 4 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 5 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 3 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_LOG.c | 4 | ||||
-rw-r--r-- | net/ipv6/raw.c | 2 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 26 | ||||
-rw-r--r-- | net/ipv6/route.c | 2 | ||||
-rw-r--r-- | net/ipv6/sit.c | 18 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 4 | ||||
-rw-r--r-- | net/ipv6/udp.c | 4 |
18 files changed, 54 insertions, 52 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 052f99eaf2ac..b41c5d8b2789 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -232,7 +232,7 @@ static inline unsigned ipv6_addr_scope2type(unsigned scope) | |||
232 | 232 | ||
233 | int __ipv6_addr_type(const struct in6_addr *addr) | 233 | int __ipv6_addr_type(const struct in6_addr *addr) |
234 | { | 234 | { |
235 | u32 st; | 235 | __be32 st; |
236 | 236 | ||
237 | st = addr->s6_addr32[0]; | 237 | st = addr->s6_addr32[0]; |
238 | 238 | ||
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 1eb1c7f261d4..87c8f54872b7 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -222,7 +222,7 @@ lookup_protocol: | |||
222 | * the user to assign a number at socket | 222 | * the user to assign a number at socket |
223 | * creation time automatically shares. | 223 | * creation time automatically shares. |
224 | */ | 224 | */ |
225 | inet->sport = ntohs(inet->num); | 225 | inet->sport = htons(inet->num); |
226 | sk->sk_prot->hash(sk); | 226 | sk->sk_prot->hash(sk); |
227 | } | 227 | } |
228 | if (sk->sk_prot->init) { | 228 | if (sk->sk_prot->init) { |
@@ -342,7 +342,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
342 | sk->sk_userlocks |= SOCK_BINDADDR_LOCK; | 342 | sk->sk_userlocks |= SOCK_BINDADDR_LOCK; |
343 | if (snum) | 343 | if (snum) |
344 | sk->sk_userlocks |= SOCK_BINDPORT_LOCK; | 344 | sk->sk_userlocks |= SOCK_BINDPORT_LOCK; |
345 | inet->sport = ntohs(inet->num); | 345 | inet->sport = htons(inet->num); |
346 | inet->dport = 0; | 346 | inet->dport = 0; |
347 | inet->daddr = 0; | 347 | inet->daddr = 0; |
348 | out: | 348 | out: |
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index a67434af691f..5c94fea90e97 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -207,7 +207,7 @@ out: | |||
207 | } | 207 | } |
208 | 208 | ||
209 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | 209 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, |
210 | u16 port, u32 info, u8 *payload) | 210 | __be16 port, u32 info, u8 *payload) |
211 | { | 211 | { |
212 | struct ipv6_pinfo *np = inet6_sk(sk); | 212 | struct ipv6_pinfo *np = inet6_sk(sk); |
213 | struct icmp6hdr *icmph = (struct icmp6hdr *)skb->h.raw; | 213 | struct icmp6hdr *icmph = (struct icmp6hdr *)skb->h.raw; |
@@ -324,7 +324,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
324 | } else { | 324 | } else { |
325 | ipv6_addr_set(&sin->sin6_addr, 0, 0, | 325 | ipv6_addr_set(&sin->sin6_addr, 0, 0, |
326 | htonl(0xffff), | 326 | htonl(0xffff), |
327 | *(u32*)(skb->nh.raw + serr->addr_offset)); | 327 | *(__be32*)(skb->nh.raw + serr->addr_offset)); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
@@ -397,7 +397,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) | |||
397 | } | 397 | } |
398 | 398 | ||
399 | if (np->rxopt.bits.rxtclass) { | 399 | if (np->rxopt.bits.rxtclass) { |
400 | int tclass = (ntohl(*(u32 *)skb->nh.ipv6h) >> 20) & 0xff; | 400 | int tclass = (ntohl(*(__be32 *)skb->nh.ipv6h) >> 20) & 0xff; |
401 | put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass); | 401 | put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass); |
402 | } | 402 | } |
403 | 403 | ||
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 27829cc4ce88..0711f92d6a12 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -655,7 +655,7 @@ static int ipv6_hop_jumbo(struct sk_buff **skbp, int optoff) | |||
655 | goto drop; | 655 | goto drop; |
656 | } | 656 | } |
657 | 657 | ||
658 | pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2)); | 658 | pkt_len = ntohl(*(__be32*)(skb->nh.raw+optoff+2)); |
659 | if (pkt_len <= IPV6_MAXPLEN) { | 659 | if (pkt_len <= IPV6_MAXPLEN) { |
660 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); | 660 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); |
661 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2); | 661 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2); |
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c index 315bc1fbec3f..21cbbbddaf4d 100644 --- a/net/ipv6/exthdrs_core.c +++ b/net/ipv6/exthdrs_core.c | |||
@@ -77,7 +77,7 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp) | |||
77 | if (hp == NULL) | 77 | if (hp == NULL) |
78 | return -1; | 78 | return -1; |
79 | if (nexthdr == NEXTHDR_FRAGMENT) { | 79 | if (nexthdr == NEXTHDR_FRAGMENT) { |
80 | unsigned short _frag_off, *fp; | 80 | __be16 _frag_off, *fp; |
81 | fp = skb_header_pointer(skb, | 81 | fp = skb_header_pointer(skb, |
82 | start+offsetof(struct frag_hdr, | 82 | start+offsetof(struct frag_hdr, |
83 | frag_off), | 83 | frag_off), |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index c598962eaa40..c700302ad51a 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -55,16 +55,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict); | |||
55 | static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport, | 55 | static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport, |
56 | const u32 rnd, const u16 synq_hsize) | 56 | const u32 rnd, const u16 synq_hsize) |
57 | { | 57 | { |
58 | u32 a = raddr->s6_addr32[0]; | 58 | u32 a = (__force u32)raddr->s6_addr32[0]; |
59 | u32 b = raddr->s6_addr32[1]; | 59 | u32 b = (__force u32)raddr->s6_addr32[1]; |
60 | u32 c = raddr->s6_addr32[2]; | 60 | u32 c = (__force u32)raddr->s6_addr32[2]; |
61 | 61 | ||
62 | a += JHASH_GOLDEN_RATIO; | 62 | a += JHASH_GOLDEN_RATIO; |
63 | b += JHASH_GOLDEN_RATIO; | 63 | b += JHASH_GOLDEN_RATIO; |
64 | c += rnd; | 64 | c += rnd; |
65 | __jhash_mix(a, b, c); | 65 | __jhash_mix(a, b, c); |
66 | 66 | ||
67 | a += raddr->s6_addr32[3]; | 67 | a += (__force u32)raddr->s6_addr32[3]; |
68 | b += (__force u32)rport; | 68 | b += (__force u32)rport; |
69 | __jhash_mix(a, b, c); | 69 | __jhash_mix(a, b, c); |
70 | 70 | ||
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index f98ca30d7c1f..bf526115e518 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -139,9 +139,9 @@ static __inline__ u32 fib6_new_sernum(void) | |||
139 | * test bit | 139 | * test bit |
140 | */ | 140 | */ |
141 | 141 | ||
142 | static __inline__ int addr_bit_set(void *token, int fn_bit) | 142 | static __inline__ __be32 addr_bit_set(void *token, int fn_bit) |
143 | { | 143 | { |
144 | __u32 *addr = token; | 144 | __be32 *addr = token; |
145 | 145 | ||
146 | return htonl(1 << ((~fn_bit)&0x1F)) & addr[fn_bit>>5]; | 146 | return htonl(1 << ((~fn_bit)&0x1F)) & addr[fn_bit>>5]; |
147 | } | 147 | } |
@@ -434,7 +434,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, | |||
434 | struct fib6_node *pn = NULL; | 434 | struct fib6_node *pn = NULL; |
435 | struct rt6key *key; | 435 | struct rt6key *key; |
436 | int bit; | 436 | int bit; |
437 | int dir = 0; | 437 | __be32 dir = 0; |
438 | __u32 sernum = fib6_new_sernum(); | 438 | __u32 sernum = fib6_new_sernum(); |
439 | 439 | ||
440 | RT6_TRACE("fib6_add_1\n"); | 440 | RT6_TRACE("fib6_add_1\n"); |
@@ -829,7 +829,7 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root, | |||
829 | struct lookup_args *args) | 829 | struct lookup_args *args) |
830 | { | 830 | { |
831 | struct fib6_node *fn; | 831 | struct fib6_node *fn; |
832 | int dir; | 832 | __be32 dir; |
833 | 833 | ||
834 | if (unlikely(args->offset == 0)) | 834 | if (unlikely(args->offset == 0)) |
835 | return NULL; | 835 | return NULL; |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 80a11909159d..25bc5ed49104 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -66,7 +66,7 @@ MODULE_LICENSE("GPL"); | |||
66 | 66 | ||
67 | #define HASH_SIZE 32 | 67 | #define HASH_SIZE 32 |
68 | 68 | ||
69 | #define HASH(addr) (((addr)->s6_addr32[0] ^ (addr)->s6_addr32[1] ^ \ | 69 | #define HASH(addr) ((__force u32)((addr)->s6_addr32[0] ^ (addr)->s6_addr32[1] ^ \ |
70 | (addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \ | 70 | (addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \ |
71 | (HASH_SIZE - 1)) | 71 | (HASH_SIZE - 1)) |
72 | 72 | ||
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c index 7ccdc8fc5a31..be7dd7db65d7 100644 --- a/net/ipv6/mip6.c +++ b/net/ipv6/mip6.c | |||
@@ -262,10 +262,10 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct | |||
262 | sel.proto = fl->proto; | 262 | sel.proto = fl->proto; |
263 | sel.dport = xfrm_flowi_dport(fl); | 263 | sel.dport = xfrm_flowi_dport(fl); |
264 | if (sel.dport) | 264 | if (sel.dport) |
265 | sel.dport_mask = ~((__u16)0); | 265 | sel.dport_mask = htons(~0); |
266 | sel.sport = xfrm_flowi_sport(fl); | 266 | sel.sport = xfrm_flowi_sport(fl); |
267 | if (sel.sport) | 267 | if (sel.sport) |
268 | sel.sport_mask = ~((__u16)0); | 268 | sel.sport_mask = htons(~0); |
269 | sel.ifindex = fl->oif; | 269 | sel.ifindex = fl->oif; |
270 | 270 | ||
271 | err = km_report(IPPROTO_DSTOPTS, &sel, | 271 | err = km_report(IPPROTO_DSTOPTS, &sel, |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 1342be8b4cdc..56ea92837307 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1267,10 +1267,11 @@ skip_defrtr: | |||
1267 | } | 1267 | } |
1268 | 1268 | ||
1269 | if (ndopts.nd_opts_mtu) { | 1269 | if (ndopts.nd_opts_mtu) { |
1270 | __be32 n; | ||
1270 | u32 mtu; | 1271 | u32 mtu; |
1271 | 1272 | ||
1272 | memcpy(&mtu, ((u8*)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu)); | 1273 | memcpy(&n, ((u8*)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu)); |
1273 | mtu = ntohl(mtu); | 1274 | mtu = ntohl(n); |
1274 | 1275 | ||
1275 | if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { | 1276 | if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { |
1276 | ND_PRINTK2(KERN_WARNING | 1277 | ND_PRINTK2(KERN_WARNING |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 204e02162d49..f63fb86d7c7b 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -1481,7 +1481,8 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | |||
1481 | if (hp == NULL) | 1481 | if (hp == NULL) |
1482 | return -EBADMSG; | 1482 | return -EBADMSG; |
1483 | if (nexthdr == NEXTHDR_FRAGMENT) { | 1483 | if (nexthdr == NEXTHDR_FRAGMENT) { |
1484 | unsigned short _frag_off, *fp; | 1484 | unsigned short _frag_off; |
1485 | __be16 *fp; | ||
1485 | fp = skb_header_pointer(skb, | 1486 | fp = skb_header_pointer(skb, |
1486 | start+offsetof(struct frag_hdr, | 1487 | start+offsetof(struct frag_hdr, |
1487 | frag_off), | 1488 | frag_off), |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index 3cb6bb79cc05..f4857cf97f05 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -69,9 +69,9 @@ static void dump_packet(const struct nf_loginfo *info, | |||
69 | /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */ | 69 | /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */ |
70 | printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ", | 70 | printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ", |
71 | ntohs(ih->payload_len) + sizeof(struct ipv6hdr), | 71 | ntohs(ih->payload_len) + sizeof(struct ipv6hdr), |
72 | (ntohl(*(u_int32_t *)ih) & 0x0ff00000) >> 20, | 72 | (ntohl(*(__be32 *)ih) & 0x0ff00000) >> 20, |
73 | ih->hop_limit, | 73 | ih->hop_limit, |
74 | (ntohl(*(u_int32_t *)ih) & 0x000fffff)); | 74 | (ntohl(*(__be32 *)ih) & 0x000fffff)); |
75 | 75 | ||
76 | fragment = 0; | 76 | fragment = 0; |
77 | ptr = ip6hoff + sizeof(struct ipv6hdr); | 77 | ptr = ip6hoff + sizeof(struct ipv6hdr); |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 813fa1d96862..b03040a20814 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -220,7 +220,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
220 | struct inet_sock *inet = inet_sk(sk); | 220 | struct inet_sock *inet = inet_sk(sk); |
221 | struct ipv6_pinfo *np = inet6_sk(sk); | 221 | struct ipv6_pinfo *np = inet6_sk(sk); |
222 | struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr; | 222 | struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr; |
223 | __u32 v4addr = 0; | 223 | __be32 v4addr = 0; |
224 | int addr_type; | 224 | int addr_type; |
225 | int err; | 225 | int err; |
226 | 226 | ||
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 3af0d5a6ceeb..6f9a9046510f 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -77,7 +77,7 @@ struct frag_queue | |||
77 | struct hlist_node list; | 77 | struct hlist_node list; |
78 | struct list_head lru_list; /* lru list member */ | 78 | struct list_head lru_list; /* lru list member */ |
79 | 79 | ||
80 | __u32 id; /* fragment id */ | 80 | __be32 id; /* fragment id */ |
81 | struct in6_addr saddr; | 81 | struct in6_addr saddr; |
82 | struct in6_addr daddr; | 82 | struct in6_addr daddr; |
83 | 83 | ||
@@ -125,28 +125,28 @@ static __inline__ void fq_unlink(struct frag_queue *fq) | |||
125 | * callers should be careful not to use the hash value outside the ipfrag_lock | 125 | * callers should be careful not to use the hash value outside the ipfrag_lock |
126 | * as doing so could race with ipfrag_hash_rnd being recalculated. | 126 | * as doing so could race with ipfrag_hash_rnd being recalculated. |
127 | */ | 127 | */ |
128 | static unsigned int ip6qhashfn(u32 id, struct in6_addr *saddr, | 128 | static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr, |
129 | struct in6_addr *daddr) | 129 | struct in6_addr *daddr) |
130 | { | 130 | { |
131 | u32 a, b, c; | 131 | u32 a, b, c; |
132 | 132 | ||
133 | a = saddr->s6_addr32[0]; | 133 | a = (__force u32)saddr->s6_addr32[0]; |
134 | b = saddr->s6_addr32[1]; | 134 | b = (__force u32)saddr->s6_addr32[1]; |
135 | c = saddr->s6_addr32[2]; | 135 | c = (__force u32)saddr->s6_addr32[2]; |
136 | 136 | ||
137 | a += JHASH_GOLDEN_RATIO; | 137 | a += JHASH_GOLDEN_RATIO; |
138 | b += JHASH_GOLDEN_RATIO; | 138 | b += JHASH_GOLDEN_RATIO; |
139 | c += ip6_frag_hash_rnd; | 139 | c += ip6_frag_hash_rnd; |
140 | __jhash_mix(a, b, c); | 140 | __jhash_mix(a, b, c); |
141 | 141 | ||
142 | a += saddr->s6_addr32[3]; | 142 | a += (__force u32)saddr->s6_addr32[3]; |
143 | b += daddr->s6_addr32[0]; | 143 | b += (__force u32)daddr->s6_addr32[0]; |
144 | c += daddr->s6_addr32[1]; | 144 | c += (__force u32)daddr->s6_addr32[1]; |
145 | __jhash_mix(a, b, c); | 145 | __jhash_mix(a, b, c); |
146 | 146 | ||
147 | a += daddr->s6_addr32[2]; | 147 | a += (__force u32)daddr->s6_addr32[2]; |
148 | b += daddr->s6_addr32[3]; | 148 | b += (__force u32)daddr->s6_addr32[3]; |
149 | c += id; | 149 | c += (__force u32)id; |
150 | __jhash_mix(a, b, c); | 150 | __jhash_mix(a, b, c); |
151 | 151 | ||
152 | return c & (IP6Q_HASHSZ - 1); | 152 | return c & (IP6Q_HASHSZ - 1); |
@@ -370,7 +370,7 @@ static struct frag_queue *ip6_frag_intern(struct frag_queue *fq_in) | |||
370 | 370 | ||
371 | 371 | ||
372 | static struct frag_queue * | 372 | static struct frag_queue * |
373 | ip6_frag_create(u32 id, struct in6_addr *src, struct in6_addr *dst, | 373 | ip6_frag_create(__be32 id, struct in6_addr *src, struct in6_addr *dst, |
374 | struct inet6_dev *idev) | 374 | struct inet6_dev *idev) |
375 | { | 375 | { |
376 | struct frag_queue *fq; | 376 | struct frag_queue *fq; |
@@ -396,7 +396,7 @@ oom: | |||
396 | } | 396 | } |
397 | 397 | ||
398 | static __inline__ struct frag_queue * | 398 | static __inline__ struct frag_queue * |
399 | fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst, | 399 | fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst, |
400 | struct inet6_dev *idev) | 400 | struct inet6_dev *idev) |
401 | { | 401 | { |
402 | struct frag_queue *fq; | 402 | struct frag_queue *fq; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index a6472cb9054c..0bf17a3cf085 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -440,7 +440,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, | |||
440 | if (pref == ICMPV6_ROUTER_PREF_INVALID) | 440 | if (pref == ICMPV6_ROUTER_PREF_INVALID) |
441 | pref = ICMPV6_ROUTER_PREF_MEDIUM; | 441 | pref = ICMPV6_ROUTER_PREF_MEDIUM; |
442 | 442 | ||
443 | lifetime = htonl(rinfo->lifetime); | 443 | lifetime = ntohl(rinfo->lifetime); |
444 | if (lifetime == 0xffffffff) { | 444 | if (lifetime == 0xffffffff) { |
445 | /* infinity */ | 445 | /* infinity */ |
446 | } else if (lifetime > 0x7fffffff/HZ) { | 446 | } else if (lifetime > 0x7fffffff/HZ) { |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index be699f85b2c7..85ff3dc45148 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -60,7 +60,7 @@ | |||
60 | */ | 60 | */ |
61 | 61 | ||
62 | #define HASH_SIZE 16 | 62 | #define HASH_SIZE 16 |
63 | #define HASH(addr) ((addr^(addr>>4))&0xF) | 63 | #define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF) |
64 | 64 | ||
65 | static int ipip6_fb_tunnel_init(struct net_device *dev); | 65 | static int ipip6_fb_tunnel_init(struct net_device *dev); |
66 | static int ipip6_tunnel_init(struct net_device *dev); | 66 | static int ipip6_tunnel_init(struct net_device *dev); |
@@ -76,7 +76,7 @@ static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunne | |||
76 | 76 | ||
77 | static DEFINE_RWLOCK(ipip6_lock); | 77 | static DEFINE_RWLOCK(ipip6_lock); |
78 | 78 | ||
79 | static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local) | 79 | static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local) |
80 | { | 80 | { |
81 | unsigned h0 = HASH(remote); | 81 | unsigned h0 = HASH(remote); |
82 | unsigned h1 = HASH(local); | 82 | unsigned h1 = HASH(local); |
@@ -102,8 +102,8 @@ static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local) | |||
102 | 102 | ||
103 | static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t) | 103 | static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t) |
104 | { | 104 | { |
105 | u32 remote = t->parms.iph.daddr; | 105 | __be32 remote = t->parms.iph.daddr; |
106 | u32 local = t->parms.iph.saddr; | 106 | __be32 local = t->parms.iph.saddr; |
107 | unsigned h = 0; | 107 | unsigned h = 0; |
108 | int prio = 0; | 108 | int prio = 0; |
109 | 109 | ||
@@ -144,8 +144,8 @@ static void ipip6_tunnel_link(struct ip_tunnel *t) | |||
144 | 144 | ||
145 | static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) | 145 | static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) |
146 | { | 146 | { |
147 | u32 remote = parms->iph.daddr; | 147 | __be32 remote = parms->iph.daddr; |
148 | u32 local = parms->iph.saddr; | 148 | __be32 local = parms->iph.saddr; |
149 | struct ip_tunnel *t, **tp, *nt; | 149 | struct ip_tunnel *t, **tp, *nt; |
150 | struct net_device *dev; | 150 | struct net_device *dev; |
151 | unsigned h = 0; | 151 | unsigned h = 0; |
@@ -405,9 +405,9 @@ out: | |||
405 | /* Returns the embedded IPv4 address if the IPv6 address | 405 | /* Returns the embedded IPv4 address if the IPv6 address |
406 | comes from 6to4 (RFC 3056) addr space */ | 406 | comes from 6to4 (RFC 3056) addr space */ |
407 | 407 | ||
408 | static inline u32 try_6to4(struct in6_addr *v6dst) | 408 | static inline __be32 try_6to4(struct in6_addr *v6dst) |
409 | { | 409 | { |
410 | u32 dst = 0; | 410 | __be32 dst = 0; |
411 | 411 | ||
412 | if (v6dst->s6_addr16[0] == htons(0x2002)) { | 412 | if (v6dst->s6_addr16[0] == htons(0x2002)) { |
413 | /* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ | 413 | /* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ |
@@ -432,7 +432,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
432 | struct net_device *tdev; /* Device to other host */ | 432 | struct net_device *tdev; /* Device to other host */ |
433 | struct iphdr *iph; /* Our new IP header */ | 433 | struct iphdr *iph; /* Our new IP header */ |
434 | int max_headroom; /* The extra header space needed */ | 434 | int max_headroom; /* The extra header space needed */ |
435 | u32 dst = tiph->daddr; | 435 | __be32 dst = tiph->daddr; |
436 | int mtu; | 436 | int mtu; |
437 | struct in6_addr *addr6; | 437 | struct in6_addr *addr6; |
438 | int addr_type; | 438 | int addr_type; |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index edef7eef8341..53f270995d8a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1084,7 +1084,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, | |||
1084 | struct sk_buff *buff; | 1084 | struct sk_buff *buff; |
1085 | struct flowi fl; | 1085 | struct flowi fl; |
1086 | int tot_len = sizeof(struct tcphdr); | 1086 | int tot_len = sizeof(struct tcphdr); |
1087 | u32 *topt; | 1087 | __be32 *topt; |
1088 | #ifdef CONFIG_TCP_MD5SIG | 1088 | #ifdef CONFIG_TCP_MD5SIG |
1089 | struct tcp_md5sig_key *key; | 1089 | struct tcp_md5sig_key *key; |
1090 | struct tcp_md5sig_key tw_key; | 1090 | struct tcp_md5sig_key tw_key; |
@@ -1128,7 +1128,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, | |||
1128 | t1->ack = 1; | 1128 | t1->ack = 1; |
1129 | t1->window = htons(win); | 1129 | t1->window = htons(win); |
1130 | 1130 | ||
1131 | topt = (u32*)(t1 + 1); | 1131 | topt = (__be32 *)(t1 + 1); |
1132 | 1132 | ||
1133 | if (ts) { | 1133 | if (ts) { |
1134 | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | | 1134 | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 5a64027bf2fc..e6e1f85f1bbd 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -298,8 +298,8 @@ drop: | |||
298 | } | 298 | } |
299 | 299 | ||
300 | static struct sock *udp_v6_mcast_next(struct sock *sk, | 300 | static struct sock *udp_v6_mcast_next(struct sock *sk, |
301 | u16 loc_port, struct in6_addr *loc_addr, | 301 | __be16 loc_port, struct in6_addr *loc_addr, |
302 | u16 rmt_port, struct in6_addr *rmt_addr, | 302 | __be16 rmt_port, struct in6_addr *rmt_addr, |
303 | int dif) | 303 | int dif) |
304 | { | 304 | { |
305 | struct hlist_node *node; | 305 | struct hlist_node *node; |