diff options
-rw-r--r-- | net/sctp/socket.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index faa48ff5cf4b..f23ad913dc7a 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -4285,19 +4285,18 @@ static void sctp_shutdown(struct sock *sk, int how) | |||
4285 | { | 4285 | { |
4286 | struct net *net = sock_net(sk); | 4286 | struct net *net = sock_net(sk); |
4287 | struct sctp_endpoint *ep; | 4287 | struct sctp_endpoint *ep; |
4288 | struct sctp_association *asoc; | ||
4289 | 4288 | ||
4290 | if (!sctp_style(sk, TCP)) | 4289 | if (!sctp_style(sk, TCP)) |
4291 | return; | 4290 | return; |
4292 | 4291 | ||
4293 | if (how & SEND_SHUTDOWN) { | 4292 | ep = sctp_sk(sk)->ep; |
4293 | if (how & SEND_SHUTDOWN && !list_empty(&ep->asocs)) { | ||
4294 | struct sctp_association *asoc; | ||
4295 | |||
4294 | sk->sk_state = SCTP_SS_CLOSING; | 4296 | sk->sk_state = SCTP_SS_CLOSING; |
4295 | ep = sctp_sk(sk)->ep; | 4297 | asoc = list_entry(ep->asocs.next, |
4296 | if (!list_empty(&ep->asocs)) { | 4298 | struct sctp_association, asocs); |
4297 | asoc = list_entry(ep->asocs.next, | 4299 | sctp_primitive_SHUTDOWN(net, asoc, NULL); |
4298 | struct sctp_association, asocs); | ||
4299 | sctp_primitive_SHUTDOWN(net, asoc, NULL); | ||
4300 | } | ||
4301 | } | 4300 | } |
4302 | } | 4301 | } |
4303 | 4302 | ||