- sync fedora branch
authorMark Huang <mlhuang@cs.princeton.edu>
Sun, 21 Aug 2005 00:34:22 +0000 (00:34 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Sun, 21 Aug 2005 00:34:22 +0000 (00:34 +0000)
net/ipv4/tcp.c
net/ipv4/tcp_timer.c
net/ipv6/tcp_ipv6.c

index fdd3958..a2b9d5c 100644 (file)
@@ -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;
        };
index 900d967..799ebe0 100644 (file)
@@ -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;
                        }
index e4b1f42..0f69e80 100644 (file)
@@ -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;