diff options
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r-- | include/net/inet_sock.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index a448bb226bb3..ce6da97bc848 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -167,10 +167,10 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
167 | 167 | ||
168 | extern int inet_sk_rebuild_header(struct sock *sk); | 168 | extern int inet_sk_rebuild_header(struct sock *sk); |
169 | 169 | ||
170 | static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, | 170 | static 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, | |||
179 | static inline int inet_sk_ehashfn(const struct sock *sk) | 179 | static 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 | } |