Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78210
b: refs/heads/master
c: ce865a6
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Jan 28, 2008
1 parent 5b68e3e commit 9194b3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: d83bd95bf11444993b9c405b255ffa644c32d414
refs/heads/master: ce865a61c810c971b47f57c729ec6e9b2d522d94
15 changes: 13 additions & 2 deletions trunk/net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ static inline int dccp_listen_start(struct sock *sk, int backlog)
return inet_csk_listen_start(sk, backlog);
}

static inline int dccp_need_reset(int state)
{
return state != DCCP_CLOSED && state != DCCP_LISTEN &&
state != DCCP_REQUESTING;
}

int dccp_disconnect(struct sock *sk, int flags)
{
struct inet_connection_sock *icsk = inet_csk(sk);
Expand All @@ -286,10 +292,15 @@ int dccp_disconnect(struct sock *sk, int flags)
if (old_state != DCCP_CLOSED)
dccp_set_state(sk, DCCP_CLOSED);

/* ABORT function of RFC793 */
/*
* This corresponds to the ABORT function of RFC793, sec. 3.8
* TCP uses a RST segment, DCCP a Reset packet with Code 2, "Aborted".
*/
if (old_state == DCCP_LISTEN) {
inet_csk_listen_stop(sk);
/* FIXME: do the active reset thing */
} else if (dccp_need_reset(old_state)) {
dccp_send_reset(sk, DCCP_RESET_CODE_ABORTED);
sk->sk_err = ECONNRESET;
} else if (old_state == DCCP_REQUESTING)
sk->sk_err = ECONNRESET;

Expand Down

0 comments on commit 9194b3d

Please sign in to comment.