Commit e69a4adc authored by Al Viro's avatar Al Viro Committed by David S. Miller

[IPV6]: Misc endianness annotations.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b09b845c
...@@ -35,9 +35,9 @@ struct prefix_info { ...@@ -35,9 +35,9 @@ struct prefix_info {
#else #else
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
__u32 valid; __be32 valid;
__u32 prefered; __be32 prefered;
__u32 reserved2; __be32 reserved2;
struct in6_addr prefix; struct in6_addr prefix;
}; };
...@@ -183,7 +183,7 @@ static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr) ...@@ -183,7 +183,7 @@ static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr)
* This will include the IEEE address token on links that support it. * This will include the IEEE address token on links that support it.
*/ */
word = addr->s6_addr32[2] ^ addr->s6_addr32[3]; word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]);
word ^= (word >> 16); word ^= (word >> 16);
word ^= (word >> 8); word ^= (word >> 8);
......
...@@ -20,7 +20,7 @@ struct route_info { ...@@ -20,7 +20,7 @@ struct route_info {
route_pref:2, route_pref:2,
reserved_h:3; reserved_h:3;
#endif #endif
__u32 lifetime; __be32 lifetime;
__u8 prefix[0]; /* 0,8 or 16 */ __u8 prefix[0]; /* 0,8 or 16 */
}; };
......
...@@ -563,7 +563,7 @@ extern int ip6_datagram_connect(struct sock *sk, ...@@ -563,7 +563,7 @@ extern int ip6_datagram_connect(struct sock *sk,
struct sockaddr *addr, int addr_len); struct sockaddr *addr, int addr_len);
extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port, extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
u32 info, u8 *payload); u32 info, u8 *payload);
extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info);
......
...@@ -66,8 +66,8 @@ struct rs_msg { ...@@ -66,8 +66,8 @@ struct rs_msg {
struct ra_msg { struct ra_msg {
struct icmp6hdr icmph; struct icmp6hdr icmph;
__u32 reachable_time; __be32 reachable_time;
__u32 retrans_timer; __be32 retrans_timer;
}; };
struct nd_opt_hdr { struct nd_opt_hdr {
......
...@@ -232,7 +232,7 @@ static inline unsigned ipv6_addr_scope2type(unsigned scope) ...@@ -232,7 +232,7 @@ static inline unsigned ipv6_addr_scope2type(unsigned scope)
int __ipv6_addr_type(const struct in6_addr *addr) int __ipv6_addr_type(const struct in6_addr *addr)
{ {
u32 st; __be32 st;
st = addr->s6_addr32[0]; st = addr->s6_addr32[0];
......
...@@ -222,7 +222,7 @@ static int inet6_create(struct socket *sock, int protocol) ...@@ -222,7 +222,7 @@ static int inet6_create(struct socket *sock, int protocol)
* the user to assign a number at socket * the user to assign a number at socket
* creation time automatically shares. * creation time automatically shares.
*/ */
inet->sport = ntohs(inet->num); inet->sport = htons(inet->num);
sk->sk_prot->hash(sk); sk->sk_prot->hash(sk);
} }
if (sk->sk_prot->init) { if (sk->sk_prot->init) {
...@@ -342,7 +342,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -342,7 +342,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
sk->sk_userlocks |= SOCK_BINDADDR_LOCK; sk->sk_userlocks |= SOCK_BINDADDR_LOCK;
if (snum) if (snum)
sk->sk_userlocks |= SOCK_BINDPORT_LOCK; sk->sk_userlocks |= SOCK_BINDPORT_LOCK;
inet->sport = ntohs(inet->num); inet->sport = htons(inet->num);
inet->dport = 0; inet->dport = 0;
inet->daddr = 0; inet->daddr = 0;
out: out:
......
...@@ -207,7 +207,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -207,7 +207,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
} }
void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
u16 port, u32 info, u8 *payload) __be16 port, u32 info, u8 *payload)
{ {
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct icmp6hdr *icmph = (struct icmp6hdr *)skb->h.raw; 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,7 +324,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
} else { } else {
ipv6_addr_set(&sin->sin6_addr, 0, 0, ipv6_addr_set(&sin->sin6_addr, 0, 0,
htonl(0xffff), htonl(0xffff),
*(u32*)(skb->nh.raw + serr->addr_offset)); *(__be32*)(skb->nh.raw + serr->addr_offset));
} }
} }
...@@ -397,7 +397,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) ...@@ -397,7 +397,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
} }
if (np->rxopt.bits.rxtclass) { if (np->rxopt.bits.rxtclass) {
int tclass = (ntohl(*(u32 *)skb->nh.ipv6h) >> 20) & 0xff; int tclass = (ntohl(*(__be32 *)skb->nh.ipv6h) >> 20) & 0xff;
put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass); put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass);
} }
......
...@@ -655,7 +655,7 @@ static int ipv6_hop_jumbo(struct sk_buff **skbp, int optoff) ...@@ -655,7 +655,7 @@ static int ipv6_hop_jumbo(struct sk_buff **skbp, int optoff)
goto drop; goto drop;
} }
pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2)); pkt_len = ntohl(*(__be32*)(skb->nh.raw+optoff+2));
if (pkt_len <= IPV6_MAXPLEN) { if (pkt_len <= IPV6_MAXPLEN) {
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
......
...@@ -77,7 +77,7 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp) ...@@ -77,7 +77,7 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp)
if (hp == NULL) if (hp == NULL)
return -1; return -1;
if (nexthdr == NEXTHDR_FRAGMENT) { if (nexthdr == NEXTHDR_FRAGMENT) {
unsigned short _frag_off, *fp; __be16 _frag_off, *fp;
fp = skb_header_pointer(skb, fp = skb_header_pointer(skb,
start+offsetof(struct frag_hdr, start+offsetof(struct frag_hdr,
frag_off), frag_off),
......
...@@ -55,16 +55,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict); ...@@ -55,16 +55,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict);
static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport, static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport,
const u32 rnd, const u16 synq_hsize) const u32 rnd, const u16 synq_hsize)
{ {
u32 a = raddr->s6_addr32[0]; u32 a = (__force u32)raddr->s6_addr32[0];
u32 b = raddr->s6_addr32[1]; u32 b = (__force u32)raddr->s6_addr32[1];
u32 c = raddr->s6_addr32[2]; u32 c = (__force u32)raddr->s6_addr32[2];
a += JHASH_GOLDEN_RATIO; a += JHASH_GOLDEN_RATIO;
b += JHASH_GOLDEN_RATIO; b += JHASH_GOLDEN_RATIO;
c += rnd; c += rnd;
__jhash_mix(a, b, c); __jhash_mix(a, b, c);
a += raddr->s6_addr32[3]; a += (__force u32)raddr->s6_addr32[3];
b += (__force u32)rport; b += (__force u32)rport;
__jhash_mix(a, b, c); __jhash_mix(a, b, c);
......
...@@ -139,9 +139,9 @@ static __inline__ u32 fib6_new_sernum(void) ...@@ -139,9 +139,9 @@ static __inline__ u32 fib6_new_sernum(void)
* test bit * test bit
*/ */
static __inline__ int addr_bit_set(void *token, int fn_bit) static __inline__ __be32 addr_bit_set(void *token, int fn_bit)
{ {
__u32 *addr = token; __be32 *addr = token;
return htonl(1 << ((~fn_bit)&0x1F)) & addr[fn_bit>>5]; return htonl(1 << ((~fn_bit)&0x1F)) & addr[fn_bit>>5];
} }
...@@ -434,7 +434,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, ...@@ -434,7 +434,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
struct fib6_node *pn = NULL; struct fib6_node *pn = NULL;
struct rt6key *key; struct rt6key *key;
int bit; int bit;
int dir = 0; __be32 dir = 0;
__u32 sernum = fib6_new_sernum(); __u32 sernum = fib6_new_sernum();
RT6_TRACE("fib6_add_1\n"); RT6_TRACE("fib6_add_1\n");
...@@ -829,7 +829,7 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root, ...@@ -829,7 +829,7 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
struct lookup_args *args) struct lookup_args *args)
{ {
struct fib6_node *fn; struct fib6_node *fn;
int dir; __be32 dir;
if (unlikely(args->offset == 0)) if (unlikely(args->offset == 0))
return NULL; return NULL;
......
...@@ -66,7 +66,7 @@ MODULE_LICENSE("GPL"); ...@@ -66,7 +66,7 @@ MODULE_LICENSE("GPL");
#define HASH_SIZE 32 #define HASH_SIZE 32
#define HASH(addr) (((addr)->s6_addr32[0] ^ (addr)->s6_addr32[1] ^ \ #define HASH(addr) ((__force u32)((addr)->s6_addr32[0] ^ (addr)->s6_addr32[1] ^ \
(addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \ (addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \
(HASH_SIZE - 1)) (HASH_SIZE - 1))
......
...@@ -262,10 +262,10 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct ...@@ -262,10 +262,10 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct
sel.proto = fl->proto; sel.proto = fl->proto;
sel.dport = xfrm_flowi_dport(fl); sel.dport = xfrm_flowi_dport(fl);
if (sel.dport) if (sel.dport)
sel.dport_mask = ~((__u16)0); sel.dport_mask = htons(~0);
sel.sport = xfrm_flowi_sport(fl); sel.sport = xfrm_flowi_sport(fl);
if (sel.sport) if (sel.sport)
sel.sport_mask = ~((__u16)0); sel.sport_mask = htons(~0);
sel.ifindex = fl->oif; sel.ifindex = fl->oif;
err = km_report(IPPROTO_DSTOPTS, &sel, err = km_report(IPPROTO_DSTOPTS, &sel,
......
...@@ -1267,10 +1267,11 @@ static void ndisc_router_discovery(struct sk_buff *skb) ...@@ -1267,10 +1267,11 @@ static void ndisc_router_discovery(struct sk_buff *skb)
} }
if (ndopts.nd_opts_mtu) { if (ndopts.nd_opts_mtu) {
__be32 n;
u32 mtu; u32 mtu;
memcpy(&mtu, ((u8*)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu)); memcpy(&n, ((u8*)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu));
mtu = ntohl(mtu); mtu = ntohl(n);
if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) {
ND_PRINTK2(KERN_WARNING ND_PRINTK2(KERN_WARNING
......
...@@ -1481,7 +1481,8 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, ...@@ -1481,7 +1481,8 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
if (hp == NULL) if (hp == NULL)
return -EBADMSG; return -EBADMSG;
if (nexthdr == NEXTHDR_FRAGMENT) { if (nexthdr == NEXTHDR_FRAGMENT) {
unsigned short _frag_off, *fp; unsigned short _frag_off;
__be16 *fp;
fp = skb_header_pointer(skb, fp = skb_header_pointer(skb,
start+offsetof(struct frag_hdr, start+offsetof(struct frag_hdr,
frag_off), frag_off),
......
...@@ -69,9 +69,9 @@ static void dump_packet(const struct nf_loginfo *info, ...@@ -69,9 +69,9 @@ static void dump_packet(const struct nf_loginfo *info,
/* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */ /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */
printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ", printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ",
ntohs(ih->payload_len) + sizeof(struct ipv6hdr), ntohs(ih->payload_len) + sizeof(struct ipv6hdr),
(ntohl(*(u_int32_t *)ih) & 0x0ff00000) >> 20, (ntohl(*(__be32 *)ih) & 0x0ff00000) >> 20,
ih->hop_limit, ih->hop_limit,
(ntohl(*(u_int32_t *)ih) & 0x000fffff)); (ntohl(*(__be32 *)ih) & 0x000fffff));
fragment = 0; fragment = 0;
ptr = ip6hoff + sizeof(struct ipv6hdr); ptr = ip6hoff + sizeof(struct ipv6hdr);
......
...@@ -220,7 +220,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -220,7 +220,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
struct inet_sock *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr; struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr;
__u32 v4addr = 0; __be32 v4addr = 0;
int addr_type; int addr_type;
int err; int err;
......
...@@ -77,7 +77,7 @@ struct frag_queue ...@@ -77,7 +77,7 @@ struct frag_queue
struct hlist_node list; struct hlist_node list;
struct list_head lru_list; /* lru list member */ struct list_head lru_list; /* lru list member */
__u32 id; /* fragment id */ __be32 id; /* fragment id */
struct in6_addr saddr; struct in6_addr saddr;
struct in6_addr daddr; struct in6_addr daddr;
...@@ -125,28 +125,28 @@ static __inline__ void fq_unlink(struct frag_queue *fq) ...@@ -125,28 +125,28 @@ static __inline__ void fq_unlink(struct frag_queue *fq)
* callers should be careful not to use the hash value outside the ipfrag_lock * callers should be careful not to use the hash value outside the ipfrag_lock
* as doing so could race with ipfrag_hash_rnd being recalculated. * as doing so could race with ipfrag_hash_rnd being recalculated.
*/ */
static unsigned int ip6qhashfn(u32 id, struct in6_addr *saddr, static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
struct in6_addr *daddr) struct in6_addr *daddr)
{ {
u32 a, b, c; u32 a, b, c;
a = saddr->s6_addr32[0]; a = (__force u32)saddr->s6_addr32[0];
b = saddr->s6_addr32[1]; b = (__force u32)saddr->s6_addr32[1];
c = saddr->s6_addr32[2]; c = (__force u32)saddr->s6_addr32[2];
a += JHASH_GOLDEN_RATIO; a += JHASH_GOLDEN_RATIO;
b += JHASH_GOLDEN_RATIO; b += JHASH_GOLDEN_RATIO;
c += ip6_frag_hash_rnd; c += ip6_frag_hash_rnd;
__jhash_mix(a, b, c); __jhash_mix(a, b, c);
a += saddr->s6_addr32[3]; a += (__force u32)saddr->s6_addr32[3];
b += daddr->s6_addr32[0]; b += (__force u32)daddr->s6_addr32[0];
c += daddr->s6_addr32[1]; c += (__force u32)daddr->s6_addr32[1];
__jhash_mix(a, b, c); __jhash_mix(a, b, c);
a += daddr->s6_addr32[2]; a += (__force u32)daddr->s6_addr32[2];
b += daddr->s6_addr32[3]; b += (__force u32)daddr->s6_addr32[3];
c += id; c += (__force u32)id;
__jhash_mix(a, b, c); __jhash_mix(a, b, c);
return c & (IP6Q_HASHSZ - 1); return c & (IP6Q_HASHSZ - 1);
...@@ -370,7 +370,7 @@ static struct frag_queue *ip6_frag_intern(struct frag_queue *fq_in) ...@@ -370,7 +370,7 @@ static struct frag_queue *ip6_frag_intern(struct frag_queue *fq_in)
static struct frag_queue * static struct frag_queue *
ip6_frag_create(u32 id, struct in6_addr *src, struct in6_addr *dst, ip6_frag_create(__be32 id, struct in6_addr *src, struct in6_addr *dst,
struct inet6_dev *idev) struct inet6_dev *idev)
{ {
struct frag_queue *fq; struct frag_queue *fq;
...@@ -396,7 +396,7 @@ ip6_frag_create(u32 id, struct in6_addr *src, struct in6_addr *dst, ...@@ -396,7 +396,7 @@ ip6_frag_create(u32 id, struct in6_addr *src, struct in6_addr *dst,
} }
static __inline__ struct frag_queue * static __inline__ struct frag_queue *
fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst, fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst,
struct inet6_dev *idev) struct inet6_dev *idev)
{ {
struct frag_queue *fq; struct frag_queue *fq;
......
...@@ -440,7 +440,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, ...@@ -440,7 +440,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
if (pref == ICMPV6_ROUTER_PREF_INVALID) if (pref == ICMPV6_ROUTER_PREF_INVALID)
pref = ICMPV6_ROUTER_PREF_MEDIUM; pref = ICMPV6_ROUTER_PREF_MEDIUM;
lifetime = htonl(rinfo->lifetime); lifetime = ntohl(rinfo->lifetime);
if (lifetime == 0xffffffff) { if (lifetime == 0xffffffff) {
/* infinity */ /* infinity */
} else if (lifetime > 0x7fffffff/HZ) { } else if (lifetime > 0x7fffffff/HZ) {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
*/ */
#define HASH_SIZE 16 #define HASH_SIZE 16
#define HASH(addr) ((addr^(addr>>4))&0xF) #define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF)
static int ipip6_fb_tunnel_init(struct net_device *dev); static int ipip6_fb_tunnel_init(struct net_device *dev);
static int ipip6_tunnel_init(struct net_device *dev); 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,7 +76,7 @@ static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunne
static DEFINE_RWLOCK(ipip6_lock); static DEFINE_RWLOCK(ipip6_lock);
static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local) static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local)
{ {
unsigned h0 = HASH(remote); unsigned h0 = HASH(remote);
unsigned h1 = HASH(local); unsigned h1 = HASH(local);
...@@ -102,8 +102,8 @@ static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local) ...@@ -102,8 +102,8 @@ static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local)
static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t) static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t)
{ {
u32 remote = t->parms.iph.daddr; __be32 remote = t->parms.iph.daddr;
u32 local = t->parms.iph.saddr; __be32 local = t->parms.iph.saddr;
unsigned h = 0; unsigned h = 0;
int prio = 0; int prio = 0;
...@@ -144,8 +144,8 @@ static void ipip6_tunnel_link(struct ip_tunnel *t) ...@@ -144,8 +144,8 @@ static void ipip6_tunnel_link(struct ip_tunnel *t)
static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create)
{ {
u32 remote = parms->iph.daddr; __be32 remote = parms->iph.daddr;
u32 local = parms->iph.saddr; __be32 local = parms->iph.saddr;
struct ip_tunnel *t, **tp, *nt; struct ip_tunnel *t, **tp, *nt;
struct net_device *dev; struct net_device *dev;
unsigned h = 0; unsigned h = 0;
...@@ -405,9 +405,9 @@ static int ipip6_rcv(struct sk_buff *skb) ...@@ -405,9 +405,9 @@ static int ipip6_rcv(struct sk_buff *skb)
/* Returns the embedded IPv4 address if the IPv6 address /* Returns the embedded IPv4 address if the IPv6 address
comes from 6to4 (RFC 3056) addr space */ comes from 6to4 (RFC 3056) addr space */
static inline u32 try_6to4(struct in6_addr *v6dst) static inline __be32 try_6to4(struct in6_addr *v6dst)
{ {
u32 dst = 0; __be32 dst = 0;
if (v6dst->s6_addr16[0] == htons(0x2002)) { if (v6dst->s6_addr16[0] == htons(0x2002)) {
/* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ /* 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,7 +432,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
struct net_device *tdev; /* Device to other host */ struct net_device *tdev; /* Device to other host */
struct iphdr *iph; /* Our new IP header */ struct iphdr *iph; /* Our new IP header */
int max_headroom; /* The extra header space needed */ int max_headroom; /* The extra header space needed */
u32 dst = tiph->daddr; __be32 dst = tiph->daddr;
int mtu; int mtu;
struct in6_addr *addr6; struct in6_addr *addr6;
int addr_type; int addr_type;
......
...@@ -1084,7 +1084,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, ...@@ -1084,7 +1084,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw,
struct sk_buff *buff; struct sk_buff *buff;
struct flowi fl; struct flowi fl;
int tot_len = sizeof(struct tcphdr); int tot_len = sizeof(struct tcphdr);
u32 *topt; __be32 *topt;
#ifdef CONFIG_TCP_MD5SIG #ifdef CONFIG_TCP_MD5SIG
struct tcp_md5sig_key *key; struct tcp_md5sig_key *key;
struct tcp_md5sig_key tw_key; struct tcp_md5sig_key tw_key;
...@@ -1128,7 +1128,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, ...@@ -1128,7 +1128,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw,
t1->ack = 1; t1->ack = 1;
t1->window = htons(win); t1->window = htons(win);
topt = (u32*)(t1 + 1); topt = (__be32 *)(t1 + 1);
if (ts) { if (ts) {
*topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
......
...@@ -298,8 +298,8 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) ...@@ -298,8 +298,8 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
} }
static struct sock *udp_v6_mcast_next(struct sock *sk, static struct sock *udp_v6_mcast_next(struct sock *sk,
u16 loc_port, struct in6_addr *loc_addr, __be16 loc_port, struct in6_addr *loc_addr,
u16 rmt_port, struct in6_addr *rmt_addr, __be16 rmt_port, struct in6_addr *rmt_addr,
int dif) int dif)
{ {
struct hlist_node *node; struct hlist_node *node;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment