1 Index: linux+rhel4+chaos/include/linux/sysctl.h
2 ===================================================================
3 --- linux+rhel4+chaos.orig/include/linux/sysctl.h
4 +++ linux+rhel4+chaos/include/linux/sysctl.h
5 @@ -348,6 +348,8 @@ enum
6 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
7 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=110,
8 NET_TCP_SLOW_START_AFTER_IDLE=111,
10 + NET_TCP_RTO_INIT=113,
14 Index: linux+rhel4+chaos/net/ipv4/sysctl_net_ipv4.c
15 ===================================================================
16 --- linux+rhel4+chaos.orig/net/ipv4/sysctl_net_ipv4.c
17 +++ linux+rhel4+chaos/net/ipv4/sysctl_net_ipv4.c
18 @@ -49,6 +49,10 @@ extern int inet_peer_maxttl;
19 extern int inet_peer_gc_mintime;
20 extern int inet_peer_gc_maxtime;
22 +/* From tcp_timer.c */
23 +extern unsigned sysctl_tcp_rto_max;
24 +extern unsigned sysctl_tcp_rto_init;
27 static int tcp_retr1_max = 255;
28 static int ip_local_port_range_min[] = { 1, 1 };
29 @@ -699,6 +703,22 @@ ctl_table ipv4_table[] = {
31 .proc_handler = &proc_dointvec,
34 + .ctl_name = NET_TCP_RTO_MAX,
35 + .procname = "tcp_rto_max",
36 + .data = &sysctl_tcp_rto_max,
37 + .maxlen = sizeof(unsigned),
39 + .proc_handler = &proc_dointvec
42 + .ctl_name = NET_TCP_RTO_INIT,
43 + .procname = "tcp_rto_init",
44 + .data = &sysctl_tcp_rto_init,
45 + .maxlen = sizeof(unsigned),
47 + .proc_handler = &proc_dointvec
52 Index: linux+rhel4+chaos/net/ipv4/tcp_timer.c
53 ===================================================================
54 --- linux+rhel4+chaos.orig/net/ipv4/tcp_timer.c
55 +++ linux+rhel4+chaos/net/ipv4/tcp_timer.c
56 @@ -32,6 +32,9 @@ int sysctl_tcp_retries1 = TCP_RETR1;
57 int sysctl_tcp_retries2 = TCP_RETR2;
58 int sysctl_tcp_orphan_retries;
60 +unsigned sysctl_tcp_rto_max = TCP_RTO_MAX;
61 +unsigned sysctl_tcp_rto_init = TCP_TIMEOUT_INIT;
63 static void tcp_write_timer(unsigned long);
64 static void tcp_delack_timer(unsigned long);
65 static void tcp_keepalive_timer (unsigned long data);
66 @@ -104,7 +107,7 @@ static int tcp_out_of_resources(struct s
68 /* If peer does not open window for long time, or did not transmit
69 * anything for long time, penalize it. */
70 - if ((s32)(tcp_time_stamp - tp->lsndtime) > 2*TCP_RTO_MAX || !do_reset)
71 + if ((s32)(tcp_time_stamp - tp->lsndtime) > 2*sysctl_tcp_rto_max || !do_reset)
74 /* If some dubious ICMP arrived, penalize even more. */
75 @@ -186,7 +189,7 @@ static int tcp_write_timeout(struct sock
77 retry_until = sysctl_tcp_retries2;
78 if (sock_flag(sk, SOCK_DEAD)) {
79 - int alive = (tp->rto < TCP_RTO_MAX);
80 + int alive = (tp->rto < sysctl_tcp_rto_max);
82 retry_until = tcp_orphan_retries(sk, alive);
84 @@ -292,7 +295,7 @@ static void tcp_probe_timer(struct sock
85 max_probes = sysctl_tcp_retries2;
87 if (sock_flag(sk, SOCK_DEAD)) {
88 - int alive = ((tp->rto<<tp->backoff) < TCP_RTO_MAX);
89 + int alive = ((tp->rto<<tp->backoff) < sysctl_tcp_rto_max);
91 max_probes = tcp_orphan_retries(sk, alive);
93 @@ -336,7 +339,7 @@ static void tcp_retransmit_timer(struct
94 inet->num, tp->snd_una, tp->snd_nxt);
97 - if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) {
98 + if (tcp_time_stamp - tp->rcv_tstamp > sysctl_tcp_rto_max) {
102 @@ -405,7 +408,7 @@ static void tcp_retransmit_timer(struct
106 - tp->rto = min(tp->rto << 1, TCP_RTO_MAX);
107 + tp->rto = min(tp->rto << 1, sysctl_tcp_rto_max);
108 tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
109 if (tp->retransmits > sysctl_tcp_retries1)
111 @@ -502,7 +505,7 @@ static void tcp_synack_timer(struct sock
112 if (tp->defer_accept)
113 max_retries = tp->defer_accept;
115 - budget = 2*(TCP_SYNQ_HSIZE/(TCP_TIMEOUT_INIT/TCP_SYNQ_INTERVAL));
116 + budget = 2*(TCP_SYNQ_HSIZE/(sysctl_tcp_rto_init/TCP_SYNQ_INTERVAL));
117 i = lopt->clock_hand;
120 @@ -516,8 +519,8 @@ static void tcp_synack_timer(struct sock
122 if (req->retrans++ == 0)
124 - timeo = min((TCP_TIMEOUT_INIT << req->retrans),
126 + timeo = min((sysctl_tcp_rto_init << req->retrans),
127 + sysctl_tcp_rto_max);
128 req->expires = now + timeo;
129 reqp = &req->dl_next;