Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26528
b: refs/heads/master
c: 134af34
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed May 6, 2006
1 parent c5140ea commit 711eb39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c29fc4989bc2a3838b2837adc12b8aeb0feeede
refs/heads/master: 134af34632a7b3b0a98a79a2e56bf9cc927e0eac
13 changes: 10 additions & 3 deletions trunk/net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ static int dccp_close_state(struct sock *sk)
void dccp_close(struct sock *sk, long timeout)
{
struct sk_buff *skb;
int state;

lock_sock(sk);

Expand Down Expand Up @@ -882,6 +883,11 @@ void dccp_close(struct sock *sk, long timeout)
sk_stream_wait_close(sk, timeout);

adjudge_to_death:
state = sk->sk_state;
sock_hold(sk);
sock_orphan(sk);
atomic_inc(sk->sk_prot->orphan_count);

/*
* It is the last release_sock in its life. It will remove backlog.
*/
Expand All @@ -894,8 +900,9 @@ void dccp_close(struct sock *sk, long timeout)
bh_lock_sock(sk);
BUG_TRAP(!sock_owned_by_user(sk));

sock_hold(sk);
sock_orphan(sk);
/* Have we already been destroyed by a softirq or backlog? */
if (state != DCCP_CLOSED && sk->sk_state == DCCP_CLOSED)
goto out;

/*
* The last release_sock may have processed the CLOSE or RESET
Expand All @@ -915,12 +922,12 @@ void dccp_close(struct sock *sk, long timeout)
#endif
}

atomic_inc(sk->sk_prot->orphan_count);
if (sk->sk_state == DCCP_CLOSED)
inet_csk_destroy_sock(sk);

/* Otherwise, socket is reprieved until protocol close. */

out:
bh_unlock_sock(sk);
local_bh_enable();
sock_put(sk);
Expand Down

0 comments on commit 711eb39

Please sign in to comment.