]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/sctp/socket.c
[SCTP]: Fix sctp_primitive_ABORT() call in sctp_close().
[net-next-2.6.git] / net / sctp / socket.c
index fde3f55bfd4b43da353202ca25a552ad54a70940..dab15949958e97ba0a23497ea1ca7a7cba158035 100644 (file)
@@ -1289,9 +1289,13 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
                        }
                }
 
-               if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime)
-                       sctp_primitive_ABORT(asoc, NULL);
-               else
+               if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
+                       struct sctp_chunk *chunk;
+
+                       chunk = sctp_make_abort_user(asoc, NULL, 0);
+                       if (chunk)
+                               sctp_primitive_ABORT(asoc, chunk);
+               } else
                        sctp_primitive_SHUTDOWN(asoc, NULL);
        }