sk_dst_reset(sk);
sk->sk_prot->hash(sk);
+
return 0;
}
write_lock_bh(&tp->syn_wait_lock);
tp->listen_opt = NULL;
write_unlock_bh(&tp->syn_wait_lock);
-
- tp->accept_queue_tail = NULL;
- tp->accept_queue = NULL;
+ tp->accept_queue = tp->accept_queue_tail = NULL;
if (lopt->qlen) {
for (i = 0; i < TCP_SYNQ_HSIZE; i++) {
/* Find already established connection */
if (!tp->accept_queue) {
long timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
+
/* If this is a non blocking socket don't sleep */
error = -EAGAIN;
if (!timeo)
req = tp->accept_queue;
if ((tp->accept_queue = req->dl_next) == NULL)
tp->accept_queue_tail = NULL;
- newsk = req->sk;
+
+ newsk = req->sk;
sk_acceptq_removed(sk);
tcp_openreq_fastfree(req);
BUG_TRAP(newsk->sk_state != TCP_SYN_RECV);
return NULL;
}
-
/*
* Socket option code for TCP.
*/
}
}
break;
-
+
default:
err = -ENOPROTOOPT;
break;
case TCP_QUICKACK:
val = !tp->ack.pingpong;
break;
-
default:
return -ENOPROTOOPT;
};
unsigned long timeo;
if (req->retrans++ == 0)
- lopt->qlen_young--;
- timeo = min((TCP_TIMEOUT_INIT << req->retrans), TCP_RTO_MAX);
+ lopt->qlen_young--;
+ timeo = min((TCP_TIMEOUT_INIT << req->retrans),
+ TCP_RTO_MAX);
req->expires = now + timeo;
reqp = &req->dl_next;
continue;
write_unlock(&tp->syn_wait_lock);
lopt->qlen--;
if (req->retrans == 0)
- lopt->qlen_young--;
+ lopt->qlen_young--;
tcp_openreq_free(req);
continue;
}
if (!ipv6_unicast_destination(skb))
goto drop;
-
/*
* There are no SYN attacks on IPv6, yet...
*/
if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
goto drop;
-
req = tcp_openreq_alloc();
if (req == NULL)
goto drop;