diff options
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r-- | net/dccp/proto.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 11905e0cf8f7..8c125ffab1c5 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -735,7 +735,7 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
735 | goto out_discard; | 735 | goto out_discard; |
736 | 736 | ||
737 | skb_queue_tail(&sk->sk_write_queue, skb); | 737 | skb_queue_tail(&sk->sk_write_queue, skb); |
738 | dccp_write_xmit(sk,0); | 738 | dccp_write_xmit(sk); |
739 | out_release: | 739 | out_release: |
740 | release_sock(sk); | 740 | release_sock(sk); |
741 | return rc ? : len; | 741 | return rc ? : len; |
@@ -958,9 +958,22 @@ void dccp_close(struct sock *sk, long timeout) | |||
958 | /* Check zero linger _after_ checking for unread data. */ | 958 | /* Check zero linger _after_ checking for unread data. */ |
959 | sk->sk_prot->disconnect(sk, 0); | 959 | sk->sk_prot->disconnect(sk, 0); |
960 | } else if (sk->sk_state != DCCP_CLOSED) { | 960 | } else if (sk->sk_state != DCCP_CLOSED) { |
961 | /* | ||
962 | * Normal connection termination. May need to wait if there are | ||
963 | * still packets in the TX queue that are delayed by the CCID. | ||
964 | */ | ||
965 | dccp_flush_write_queue(sk, &timeout); | ||
961 | dccp_terminate_connection(sk); | 966 | dccp_terminate_connection(sk); |
962 | } | 967 | } |
963 | 968 | ||
969 | /* | ||
970 | * Flush write queue. This may be necessary in several cases: | ||
971 | * - we have been closed by the peer but still have application data; | ||
972 | * - abortive termination (unread data or zero linger time), | ||
973 | * - normal termination but queue could not be flushed within time limit | ||
974 | */ | ||
975 | __skb_queue_purge(&sk->sk_write_queue); | ||
976 | |||
964 | sk_stream_wait_close(sk, timeout); | 977 | sk_stream_wait_close(sk, timeout); |
965 | 978 | ||
966 | adjudge_to_death: | 979 | adjudge_to_death: |