Commit 3a57ff0c authored by Nivedita Singhvi's avatar Nivedita Singhvi Committed by Stephen Hemminger

[TCP]: IPV6, do not use sock_put() on timewait sockets.

parent 11b82997
...@@ -1639,7 +1639,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) ...@@ -1639,7 +1639,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
no_tcp_socket: no_tcp_socket:
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
goto discard_and_relse; goto discard_it;
if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) { if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
bad_packet: bad_packet:
...@@ -1662,12 +1662,14 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) ...@@ -1662,12 +1662,14 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
goto discard_it; goto discard_it;
do_time_wait: do_time_wait:
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
goto discard_and_relse; tcp_tw_put((struct tcp_tw_bucket *) sk);
goto discard_it;
}
if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) { if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
TCP_INC_STATS_BH(TcpInErrs); TCP_INC_STATS_BH(TcpInErrs);
sock_put(sk); tcp_tw_put((struct tcp_tw_bucket *) sk);
goto discard_it; goto discard_it;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment