diff options
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index c83938b8fcb1..22ef8bd26620 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -355,7 +355,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) | |||
355 | return; | 355 | return; |
356 | } | 356 | } |
357 | if (sk->sk_state == TCP_TIME_WAIT) { | 357 | if (sk->sk_state == TCP_TIME_WAIT) { |
358 | inet_twsk_put((struct inet_timewait_sock *)sk); | 358 | inet_twsk_put(inet_twsk(sk)); |
359 | return; | 359 | return; |
360 | } | 360 | } |
361 | 361 | ||
@@ -373,7 +373,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) | |||
373 | seq = ntohl(th->seq); | 373 | seq = ntohl(th->seq); |
374 | if (sk->sk_state != TCP_LISTEN && | 374 | if (sk->sk_state != TCP_LISTEN && |
375 | !between(seq, tp->snd_una, tp->snd_nxt)) { | 375 | !between(seq, tp->snd_una, tp->snd_nxt)) { |
376 | NET_INC_STATS(LINUX_MIB_OUTOFWINDOWICMPS); | 376 | NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); |
377 | goto out; | 377 | goto out; |
378 | } | 378 | } |
379 | 379 | ||
@@ -578,7 +578,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack, | |||
578 | struct tcphdr *th = skb->h.th; | 578 | struct tcphdr *th = skb->h.th; |
579 | struct { | 579 | struct { |
580 | struct tcphdr th; | 580 | struct tcphdr th; |
581 | u32 tsopt[3]; | 581 | u32 tsopt[TCPOLEN_TSTAMP_ALIGNED >> 2]; |
582 | } rep; | 582 | } rep; |
583 | struct ip_reply_arg arg; | 583 | struct ip_reply_arg arg; |
584 | 584 | ||
@@ -960,7 +960,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) | |||
960 | bh_lock_sock(nsk); | 960 | bh_lock_sock(nsk); |
961 | return nsk; | 961 | return nsk; |
962 | } | 962 | } |
963 | inet_twsk_put((struct inet_timewait_sock *)nsk); | 963 | inet_twsk_put(inet_twsk(nsk)); |
964 | return NULL; | 964 | return NULL; |
965 | } | 965 | } |
966 | 966 | ||
@@ -1154,26 +1154,24 @@ discard_and_relse: | |||
1154 | 1154 | ||
1155 | do_time_wait: | 1155 | do_time_wait: |
1156 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 1156 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
1157 | inet_twsk_put((struct inet_timewait_sock *) sk); | 1157 | inet_twsk_put(inet_twsk(sk)); |
1158 | goto discard_it; | 1158 | goto discard_it; |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { | 1161 | if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { |
1162 | TCP_INC_STATS_BH(TCP_MIB_INERRS); | 1162 | TCP_INC_STATS_BH(TCP_MIB_INERRS); |
1163 | inet_twsk_put((struct inet_timewait_sock *) sk); | 1163 | inet_twsk_put(inet_twsk(sk)); |
1164 | goto discard_it; | 1164 | goto discard_it; |
1165 | } | 1165 | } |
1166 | switch (tcp_timewait_state_process((struct inet_timewait_sock *)sk, | 1166 | switch (tcp_timewait_state_process(inet_twsk(sk), skb, th)) { |
1167 | skb, th)) { | ||
1168 | case TCP_TW_SYN: { | 1167 | case TCP_TW_SYN: { |
1169 | struct sock *sk2 = inet_lookup_listener(&tcp_hashinfo, | 1168 | struct sock *sk2 = inet_lookup_listener(&tcp_hashinfo, |
1170 | skb->nh.iph->daddr, | 1169 | skb->nh.iph->daddr, |
1171 | th->dest, | 1170 | th->dest, |
1172 | inet_iif(skb)); | 1171 | inet_iif(skb)); |
1173 | if (sk2) { | 1172 | if (sk2) { |
1174 | inet_twsk_deschedule((struct inet_timewait_sock *)sk, | 1173 | inet_twsk_deschedule(inet_twsk(sk), &tcp_death_row); |
1175 | &tcp_death_row); | 1174 | inet_twsk_put(inet_twsk(sk)); |
1176 | inet_twsk_put((struct inet_timewait_sock *)sk); | ||
1177 | sk = sk2; | 1175 | sk = sk2; |
1178 | goto process; | 1176 | goto process; |
1179 | } | 1177 | } |