From c7a71c555d8ae92624e1de6b2fc4d0adb74acf44 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Sun, 21 Aug 2005 00:34:22 +0000 Subject: [PATCH] - sync fedora branch --- net/ipv4/tcp.c | 13 ++++++------- net/ipv4/tcp_timer.c | 7 ++++--- net/ipv6/tcp_ipv6.c | 2 -- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index fdd3958a4..a2b9d5c6f 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -496,6 +496,7 @@ int tcp_listen_start(struct sock *sk) sk_dst_reset(sk); sk->sk_prot->hash(sk); + return 0; } @@ -526,9 +527,7 @@ static void tcp_listen_stop (struct sock *sk) 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++) { @@ -1912,6 +1911,7 @@ struct sock *tcp_accept(struct sock *sk, int flags, int *err) /* 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) @@ -1925,7 +1925,8 @@ struct sock *tcp_accept(struct sock *sk, int flags, int *err) 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); @@ -1938,7 +1939,6 @@ out: return NULL; } - /* * Socket option code for TCP. */ @@ -2097,7 +2097,7 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval, } } break; - + default: err = -ENOPROTOOPT; break; @@ -2237,7 +2237,6 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, case TCP_QUICKACK: val = !tp->ack.pingpong; break; - default: return -ENOPROTOOPT; }; diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 900d9676e..799ebe061 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -518,8 +518,9 @@ static void tcp_synack_timer(struct sock *sk) 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; @@ -531,7 +532,7 @@ static void tcp_synack_timer(struct sock *sk) write_unlock(&tp->syn_wait_lock); lopt->qlen--; if (req->retrans == 0) - lopt->qlen_young--; + lopt->qlen_young--; tcp_openreq_free(req); continue; } diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index e4b1f427d..0f69e800a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1296,7 +1296,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) if (!ipv6_unicast_destination(skb)) goto drop; - /* * There are no SYN attacks on IPv6, yet... */ @@ -1309,7 +1308,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1) goto drop; - req = tcp_openreq_alloc(); if (req == NULL) goto drop; -- 2.47.0