static void tcp_delack_timer(unsigned long);
static void tcp_keepalive_timer (unsigned long data);
-const char timer_bug_msg[] = KERN_DEBUG "tcpbug: unknown timer value\n";
+#ifdef TCP_DEBUG
+const char tcp_timer_bug_msg[] = KERN_DEBUG "tcpbug: unknown timer value\n";
+EXPORT_SYMBOL(tcp_timer_bug_msg);
+#endif
/*
* Using different timers for retransmit, delayed acks and probes
void tcp_init_xmit_timers(struct sock *sk)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
init_timer(&tp->retransmit_timer);
tp->retransmit_timer.function=&tcp_write_timer;
void tcp_clear_xmit_timers(struct sock *sk)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
tp->pending = 0;
sk_stop_timer(sk, &tp->retransmit_timer);
*/
static int tcp_out_of_resources(struct sock *sk, int do_reset)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
int orphans = atomic_read(&tcp_orphan_count);
/* If peer does not open window for long time, or did not transmit
* 1. Last segment was sent recently. */
if ((s32)(tcp_time_stamp - tp->lsndtime) <= TCP_TIMEWAIT_LEN ||
/* 2. Window is closed. */
- (!tp->snd_wnd && !tcp_get_pcount(&tp->packets_out)))
+ (!tp->snd_wnd && !tp->packets_out))
do_reset = 1;
if (do_reset)
tcp_send_active_reset(sk, GFP_ATOMIC);
/* A write timeout has occurred. Process the after effects. */
static int tcp_write_timeout(struct sock *sk)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
int retry_until;
if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {
static void tcp_delack_timer(unsigned long data)
{
struct sock *sk = (struct sock*)data;
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
bh_lock_sock(sk);
if (sock_owned_by_user(sk)) {
static void tcp_probe_timer(struct sock *sk)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
int max_probes;
- if (tcp_get_pcount(&tp->packets_out) || !sk->sk_send_head) {
+ if (tp->packets_out || !sk->sk_send_head) {
tp->probes_out = 0;
return;
}
static void tcp_retransmit_timer(struct sock *sk)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
- if (!tcp_get_pcount(&tp->packets_out))
+ if (!tp->packets_out)
goto out;
BUG_TRAP(!skb_queue_empty(&sk->sk_write_queue));
*/
#ifdef TCP_DEBUG
if (net_ratelimit()) {
- struct inet_opt *inet = inet_sk(sk);
+ struct inet_sock *inet = inet_sk(sk);
printk(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n",
NIPQUAD(inet->daddr), htons(inet->dport),
inet->num, tp->snd_una, tp->snd_nxt);
if (tp->retransmits == 0) {
if (tp->ca_state == TCP_CA_Disorder || tp->ca_state == TCP_CA_Recovery) {
- if (tp->sack_ok) {
+ if (tp->rx_opt.sack_ok) {
if (tp->ca_state == TCP_CA_Recovery)
NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERYFAIL);
else
static void tcp_write_timer(unsigned long data)
{
struct sock *sk = (struct sock*)data;
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
int event;
bh_lock_sock(sk);
static void tcp_synack_timer(struct sock *sk)
{
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
struct tcp_listen_opt *lopt = tp->listen_opt;
int max_retries = tp->syn_retries ? : sysctl_tcp_synack_retries;
int thresh = max_retries;
static void tcp_keepalive_timer (unsigned long data)
{
struct sock *sk = (struct sock *) data;
- struct tcp_opt *tp = tcp_sk(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
__u32 elapsed;
/* Only process if socket is not in use. */
elapsed = keepalive_time_when(tp);
/* It is alive without keepalive 8) */
- if (tcp_get_pcount(&tp->packets_out) || sk->sk_send_head)
+ if (tp->packets_out || sk->sk_send_head)
goto resched;
elapsed = tcp_time_stamp - tp->rcv_tstamp;