aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_statefuns.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r--net/sctp/sm_statefuns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 591b44d3b7de..01e002430c85 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -758,6 +758,12 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
758 struct sctp_chunk auth; 758 struct sctp_chunk auth;
759 sctp_ierror_t ret; 759 sctp_ierror_t ret;
760 760
761 /* Make sure that we and the peer are AUTH capable */
762 if (!net->sctp.auth_enable || !new_asoc->peer.auth_capable) {
763 sctp_association_free(new_asoc);
764 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
765 }
766
761 /* set-up our fake chunk so that we can process it */ 767 /* set-up our fake chunk so that we can process it */
762 auth.skb = chunk->auth_chunk; 768 auth.skb = chunk->auth_chunk;
763 auth.asoc = chunk->asoc; 769 auth.asoc = chunk->asoc;
@@ -768,10 +774,6 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
768 auth.transport = chunk->transport; 774 auth.transport = chunk->transport;
769 775
770 ret = sctp_sf_authenticate(net, ep, new_asoc, type, &auth); 776 ret = sctp_sf_authenticate(net, ep, new_asoc, type, &auth);
771
772 /* We can now safely free the auth_chunk clone */
773 kfree_skb(chunk->auth_chunk);
774
775 if (ret != SCTP_IERROR_NO_ERROR) { 777 if (ret != SCTP_IERROR_NO_ERROR) {
776 sctp_association_free(new_asoc); 778 sctp_association_free(new_asoc);
777 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); 779 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);