diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 8bb623d357ad..11cb4979a465 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -204,7 +204,8 @@ tb_found: | |||
204 | ret = 1; | 204 | ret = 1; |
205 | if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb, true)) { | 205 | if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb, true)) { |
206 | if (((sk->sk_reuse && sk->sk_state != TCP_LISTEN) || | 206 | if (((sk->sk_reuse && sk->sk_state != TCP_LISTEN) || |
207 | (sk->sk_reuseport && uid_eq(tb->fastuid, uid))) && | 207 | (tb->fastreuseport > 0 && |
208 | sk->sk_reuseport && uid_eq(tb->fastuid, uid))) && | ||
208 | smallest_size != -1 && --attempts >= 0) { | 209 | smallest_size != -1 && --attempts >= 0) { |
209 | spin_unlock(&head->lock); | 210 | spin_unlock(&head->lock); |
210 | goto again; | 211 | goto again; |
@@ -227,19 +228,15 @@ tb_not_found: | |||
227 | if (sk->sk_reuseport) { | 228 | if (sk->sk_reuseport) { |
228 | tb->fastreuseport = 1; | 229 | tb->fastreuseport = 1; |
229 | tb->fastuid = uid; | 230 | tb->fastuid = uid; |
230 | } else { | 231 | } else |
231 | tb->fastreuseport = 0; | 232 | tb->fastreuseport = 0; |
232 | tb->fastuid = 0; | ||
233 | } | ||
234 | } else { | 233 | } else { |
235 | if (tb->fastreuse && | 234 | if (tb->fastreuse && |
236 | (!sk->sk_reuse || sk->sk_state == TCP_LISTEN)) | 235 | (!sk->sk_reuse || sk->sk_state == TCP_LISTEN)) |
237 | tb->fastreuse = 0; | 236 | tb->fastreuse = 0; |
238 | if (tb->fastreuseport && | 237 | if (tb->fastreuseport && |
239 | (!sk->sk_reuseport || !uid_eq(tb->fastuid, uid))) { | 238 | (!sk->sk_reuseport || !uid_eq(tb->fastuid, uid))) |
240 | tb->fastreuseport = 0; | 239 | tb->fastreuseport = 0; |
241 | tb->fastuid = 0; | ||
242 | } | ||
243 | } | 240 | } |
244 | success: | 241 | success: |
245 | if (!inet_csk(sk)->icsk_bind_hash) | 242 | if (!inet_csk(sk)->icsk_bind_hash) |