aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r--include/net/inet_sock.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index f6242710f2ff..ce6da97bc848 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -36,7 +36,7 @@
36 * @ts_needaddr - Need to record addr of outgoing dev 36 * @ts_needaddr - Need to record addr of outgoing dev
37 */ 37 */
38struct ip_options { 38struct ip_options {
39 __u32 faddr; 39 __be32 faddr;
40 unsigned char optlen; 40 unsigned char optlen;
41 unsigned char srr; 41 unsigned char srr;
42 unsigned char rr; 42 unsigned char rr;
@@ -62,9 +62,9 @@ struct inet_request_sock {
62 u16 inet6_rsk_offset; 62 u16 inet6_rsk_offset;
63 /* 2 bytes hole, try to pack */ 63 /* 2 bytes hole, try to pack */
64#endif 64#endif
65 u32 loc_addr; 65 __be32 loc_addr;
66 u32 rmt_addr; 66 __be32 rmt_addr;
67 u16 rmt_port; 67 __be16 rmt_port;
68 u16 snd_wscale : 4, 68 u16 snd_wscale : 4,
69 rcv_wscale : 4, 69 rcv_wscale : 4,
70 tstamp_ok : 1, 70 tstamp_ok : 1,
@@ -110,15 +110,15 @@ struct inet_sock {
110 struct ipv6_pinfo *pinet6; 110 struct ipv6_pinfo *pinet6;
111#endif 111#endif
112 /* Socket demultiplex comparisons on incoming packets. */ 112 /* Socket demultiplex comparisons on incoming packets. */
113 __u32 daddr; 113 __be32 daddr;
114 __u32 rcv_saddr; 114 __be32 rcv_saddr;
115 __u16 dport; 115 __be16 dport;
116 __u16 num; 116 __u16 num;
117 __u32 saddr; 117 __be32 saddr;
118 __s16 uc_ttl; 118 __s16 uc_ttl;
119 __u16 cmsg_flags; 119 __u16 cmsg_flags;
120 struct ip_options *opt; 120 struct ip_options *opt;
121 __u16 sport; 121 __be16 sport;
122 __u16 id; 122 __u16 id;
123 __u8 tos; 123 __u8 tos;
124 __u8 mc_ttl; 124 __u8 mc_ttl;
@@ -129,7 +129,7 @@ struct inet_sock {
129 hdrincl:1, 129 hdrincl:1,
130 mc_loop:1; 130 mc_loop:1;
131 int mc_index; 131 int mc_index;
132 __u32 mc_addr; 132 __be32 mc_addr;
133 struct ip_mc_socklist *mc_list; 133 struct ip_mc_socklist *mc_list;
134 struct { 134 struct {
135 unsigned int flags; 135 unsigned int flags;
@@ -137,7 +137,7 @@ struct inet_sock {
137 struct ip_options *opt; 137 struct ip_options *opt;
138 struct rtable *rt; 138 struct rtable *rt;
139 int length; /* Total length of all frames */ 139 int length; /* Total length of all frames */
140 u32 addr; 140 __be32 addr;
141 struct flowi fl; 141 struct flowi fl;
142 } cork; 142 } cork;
143}; 143};
@@ -167,10 +167,10 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
167 167
168extern int inet_sk_rebuild_header(struct sock *sk); 168extern int inet_sk_rebuild_header(struct sock *sk);
169 169
170static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, 170static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
171 const __u32 faddr, const __u16 fport) 171 const __be32 faddr, const __be16 fport)
172{ 172{
173 unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); 173 unsigned int h = ((__force __u32)laddr ^ lport) ^ ((__force __u32)faddr ^ (__force __u32)fport);
174 h ^= h >> 16; 174 h ^= h >> 16;
175 h ^= h >> 8; 175 h ^= h >> 8;
176 return h; 176 return h;
@@ -179,10 +179,10 @@ static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport,
179static inline int inet_sk_ehashfn(const struct sock *sk) 179static inline int inet_sk_ehashfn(const struct sock *sk)
180{ 180{
181 const struct inet_sock *inet = inet_sk(sk); 181 const struct inet_sock *inet = inet_sk(sk);
182 const __u32 laddr = inet->rcv_saddr; 182 const __be32 laddr = inet->rcv_saddr;
183 const __u16 lport = inet->num; 183 const __u16 lport = inet->num;
184 const __u32 faddr = inet->daddr; 184 const __be32 faddr = inet->daddr;
185 const __u16 fport = inet->dport; 185 const __be16 fport = inet->dport;
186 186
187 return inet_ehashfn(laddr, lport, faddr, fport); 187 return inet_ehashfn(laddr, lport, faddr, fport);
188} 188}