vserver 1.9.3
[linux-2.6.git] / net / ipv4 / tcp_minisocks.c
index def53d8..92b873d 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/sysctl.h>
 #include <linux/workqueue.h>
+#include <linux/vs_limit.h>
 #include <linux/vs_socket.h>
 #include <net/tcp.h>
 #include <net/inet_common.h>
@@ -267,7 +268,7 @@ kill:
        }
 
        if (paws_reject)
-               NET_INC_STATS_BH(PAWSEstabRejected);
+               NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 
        if(!th->rst) {
                /* In this case we must reset the TIMEWAIT timer.
@@ -367,7 +368,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
                tw->tw_vx_info          = NULL;
                tw->tw_nid              = sk->sk_nid;
                tw->tw_nx_info          = NULL;
-               
+
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
                if (tw->tw_family == PF_INET6) {
                        struct ipv6_pinfo *np = inet6_sk(sk);
@@ -468,7 +469,7 @@ rescan:
        }
 
        tcp_tw_count -= killed;
-       NET_ADD_STATS_BH(TimeWaited, killed);
+       NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITED, killed);
 
        return ret;
 }
@@ -678,7 +679,7 @@ void tcp_twcal_tick(unsigned long dummy)
 out:
        if ((tcp_tw_count -= killed) == 0)
                del_timer(&tcp_tw_timer);
-       NET_ADD_STATS_BH(TimeWaitKilled, killed);
+       NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITKILLED, killed);
        spin_unlock(&tw_death_lock);
 }
 
@@ -693,7 +694,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
        /* allocate the newsk from the same slab of the master sock,
         * if not, at sk_free time we'll try to free it from the wrong
         * slabcache (i.e. is it TCPv4 or v6?) -acme */
-       struct sock *newsk = sk_alloc(PF_INET, GFP_ATOMIC, 0, sk->sk_slab);
+       struct sock *newsk = sk_alloc(PF_INET, GFP_ATOMIC, 0, sk->sk_prot->slab);
 
        if(newsk != NULL) {
                struct tcp_opt *newtp;
@@ -726,9 +727,10 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
                sock_reset_flag(newsk, SOCK_DONE);
                newsk->sk_userlocks = sk->sk_userlocks & ~SOCK_BINDPORT_LOCK;
                newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL;
+               newsk->sk_send_head = NULL;
                newsk->sk_callback_lock = RW_LOCK_UNLOCKED;
                skb_queue_head_init(&newsk->sk_error_queue);
-               newsk->sk_write_space = tcp_write_space;
+               newsk->sk_write_space = sk_stream_write_space;
 
                if ((filter = newsk->sk_filter) != NULL)
                        sk_filter_charge(newsk, filter);
@@ -759,11 +761,11 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
                newtp->mdev = TCP_TIMEOUT_INIT;
                newtp->rto = TCP_TIMEOUT_INIT;
 
-               newtp->packets_out = 0;
-               newtp->left_out = 0;
-               newtp->retrans_out = 0;
-               newtp->sacked_out = 0;
-               newtp->fackets_out = 0;
+               tcp_set_pcount(&newtp->packets_out, 0);
+               tcp_set_pcount(&newtp->left_out, 0);
+               tcp_set_pcount(&newtp->retrans_out, 0);
+               tcp_set_pcount(&newtp->sacked_out, 0);
+               tcp_set_pcount(&newtp->fackets_out, 0);
                newtp->snd_ssthresh = 0x7fffffff;
 
                /* So many TCP implementations out there (incorrectly) count the
@@ -774,16 +776,12 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
                newtp->snd_cwnd = 2;
                newtp->snd_cwnd_cnt = 0;
 
-               newtp->bictcp.cnt = 0;
-               newtp->bictcp.last_max_cwnd = newtp->bictcp.last_cwnd = 0;
-
                newtp->frto_counter = 0;
                newtp->frto_highmark = 0;
 
                tcp_set_ca_state(newtp, TCP_CA_Open);
                tcp_init_xmit_timers(newsk);
                skb_queue_head_init(&newtp->out_of_order_queue);
-               newtp->send_head = NULL;
                newtp->rcv_wup = req->rcv_isn + 1;
                newtp->write_seq = req->snt_isn + 1;
                newtp->pushed_seq = newtp->write_seq;
@@ -809,6 +807,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
 
                set_vx_info(&newsk->sk_vx_info, sk->sk_vx_info);
                newsk->sk_xid = sk->sk_xid;
+               vx_sock_inc(newsk);
                set_nx_info(&newsk->sk_nx_info, sk->sk_nx_info);
                newsk->sk_nid = sk->sk_nid;
 #ifdef INET_REFCNT_DEBUG
@@ -857,8 +856,9 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
                if (newtp->ecn_flags&TCP_ECN_OK)
                        newsk->sk_no_largesend = 1;
 
-               tcp_vegas_init(newtp);
-               TCP_INC_STATS_BH(TcpPassiveOpens);
+               tcp_ca_init(newtp);
+
+               TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS);
        }
        return newsk;
 }
@@ -989,7 +989,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
                if (!(flg & TCP_FLAG_RST))
                        req->class->send_ack(skb, req);
                if (paws_reject)
-                       NET_INC_STATS_BH(PAWSEstabRejected);
+                       NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
                return NULL;
        }
 
@@ -1046,7 +1046,7 @@ listen_overflow:
        }
 
 embryonic_reset:
-       NET_INC_STATS_BH(EmbryonicRsts);
+       NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
        if (!(flg & TCP_FLAG_RST))
                req->class->send_reset(skb);