Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78209
b: refs/heads/master
c: d83bd95
h: refs/heads/master
i:
  78207: 794646b
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Jan 28, 2008
1 parent b9fc395 commit 5b68e3e
Show file tree
Hide file tree
Showing 2 changed files with 9 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: dcfbc7e97a2e3a0d73a2e41e1bddb988dcca701e
refs/heads/master: d83bd95bf11444993b9c405b255ffa644c32d414
10 changes: 8 additions & 2 deletions trunk/net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ void dccp_close(struct sock *sk, long timeout)
{
struct dccp_sock *dp = dccp_sk(sk);
struct sk_buff *skb;
u32 data_was_unread = 0;
int state;

lock_sock(sk);
Expand All @@ -913,12 +914,17 @@ void dccp_close(struct sock *sk, long timeout)
* descriptor close, not protocol-sourced closes, because the
*reader process may not have drained the data yet!
*/
/* FIXME: check for unread data */
while ((skb = __skb_dequeue(&sk->sk_receive_queue)) != NULL) {
data_was_unread += skb->len;
__kfree_skb(skb);
}

if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
if (data_was_unread) {
/* Unread data was tossed, send an appropriate Reset Code */
DCCP_WARN("DCCP: ABORT -- %u bytes unread\n", data_was_unread);
dccp_send_reset(sk, DCCP_RESET_CODE_ABORTED);
dccp_set_state(sk, DCCP_CLOSED);
} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
/* Check zero linger _after_ checking for unread data. */
sk->sk_prot->disconnect(sk, 0);
} else if (dccp_close_state(sk)) {
Expand Down

0 comments on commit 5b68e3e

Please sign in to comment.