From owner-svn-src-all@FreeBSD.ORG Wed May 9 15:15:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3CB80106564A; Wed, 9 May 2012 15:15:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2671C8FC18; Wed, 9 May 2012 15:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q49FFEGm089782; Wed, 9 May 2012 15:15:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q49FFDxn089777; Wed, 9 May 2012 15:15:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205091515.q49FFDxn089777@svn.freebsd.org> From: Michael Tuexen Date: Wed, 9 May 2012 15:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235190 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2012 15:15:14 -0000 Author: tuexen Date: Wed May 9 15:15:13 2012 New Revision: 235190 URL: http://svn.freebsd.org/changeset/base/235190 Log: MFC r235066: Provide the flags in the SCTP stream reconfig related notification as specified in RFC 6525. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Wed May 9 15:11:47 2012 (r235189) +++ stable/8/sys/netinet/sctp_constants.h Wed May 9 15:15:13 2012 (r235190) @@ -779,10 +779,9 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_SPECIAL_SP_FAIL 27 #define SCTP_NOTIFY_NO_PEER_AUTH 28 #define SCTP_NOTIFY_SENDER_DRY 29 -#define SCTP_NOTIFY_STR_RESET_ADD_OK 30 -#define SCTP_NOTIFY_STR_RESET_ADD_FAIL 31 -#define SCTP_NOTIFY_STR_RESET_INSTREAM_ADD_OK 32 -#define SCTP_NOTIFY_MAX 32 +#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 30 +#define SCTP_NOTIFY_STR_RESET_DENIED_IN 31 +#define SCTP_NOTIFY_MAX 31 /* This is the value for messages that are NOT completely Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Wed May 9 15:11:47 2012 (r235189) +++ stable/8/sys/netinet/sctp_input.c Wed May 9 15:15:13 2012 (r235190) @@ -3602,6 +3602,8 @@ sctp_handle_stream_reset_response(struct if (action == SCTP_STREAM_RESET_RESULT_PERFORMED) { /* do it */ sctp_reset_out_streams(stcb, number_entries, srparam->list_of_streams); + } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_DENIED_OUT, stcb, number_entries, srparam->list_of_streams, SCTP_SO_NOT_LOCKED); } else { sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_FAILED_OUT, stcb, number_entries, srparam->list_of_streams, SCTP_SO_NOT_LOCKED); } @@ -3610,7 +3612,10 @@ sctp_handle_stream_reset_response(struct number_entries = (lparm_len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t); if (asoc->stream_reset_outstanding) asoc->stream_reset_outstanding--; - if (action != SCTP_STREAM_RESET_RESULT_PERFORMED) { + if (action == SCTP_STREAM_RESET_RESULT_DENIED) { + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_DENIED_IN, stcb, + number_entries, srparam->list_of_streams, SCTP_SO_NOT_LOCKED); + } else if (action != SCTP_STREAM_RESET_RESULT_PERFORMED) { sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_FAILED_IN, stcb, number_entries, srparam->list_of_streams, SCTP_SO_NOT_LOCKED); } @@ -3630,16 +3635,22 @@ sctp_handle_stream_reset_response(struct /* Put the new streams into effect */ stcb->asoc.streamoutcnt += num_stream; sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0); + } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { + sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, + SCTP_STREAM_CHANGE_DENIED); } else { sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, - SCTP_STREAM_CHANGED_DENIED); + SCTP_STREAM_CHANGE_FAILED); } } else if (type == SCTP_STR_RESET_ADD_IN_STREAMS) { if (asoc->stream_reset_outstanding) asoc->stream_reset_outstanding--; - if (action != SCTP_STREAM_RESET_RESULT_PERFORMED) { + if (action == SCTP_STREAM_RESET_RESULT_DENIED) { sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, - SCTP_STREAM_CHANGED_DENIED); + SCTP_STREAM_CHANGE_DENIED); + } else if (action != SCTP_STREAM_RESET_RESULT_PERFORMED) { + sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, + SCTP_STREAM_CHANGE_FAILED); } } else if (type == SCTP_STR_RESET_TSN_REQUEST) { /** @@ -3682,9 +3693,12 @@ sctp_handle_stream_reset_response(struct sctp_reset_out_streams(stcb, 0, (uint16_t *) NULL); sctp_reset_in_stream(stcb, 0, (uint16_t *) NULL); sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), 0); + } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { + sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), + SCTP_ASSOC_RESET_DENIED); } else { sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), - SCTP_STREAM_RESET_FAILED); + SCTP_ASSOC_RESET_FAILED); } } /* get rid of the request and get the request flags */ Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Wed May 9 15:11:47 2012 (r235189) +++ stable/8/sys/netinet/sctp_uio.h Wed May 9 15:15:13 2012 (r235190) @@ -454,7 +454,6 @@ struct sctp_stream_reset_event { #define SCTP_STREAM_RESET_OUTGOING_SSN 0x0002 #define SCTP_STREAM_RESET_DENIED 0x0004 #define SCTP_STREAM_RESET_FAILED 0x0008 -#define SCTP_STREAM_CHANGED_DENIED 0x0010 /* * Assoc reset event - subscribe to SCTP_ASSOC_RESET_EVENT Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Wed May 9 15:11:47 2012 (r235189) +++ stable/8/sys/netinet/sctputil.c Wed May 9 15:15:13 2012 (r235190) @@ -3507,10 +3507,18 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), (SCTP_STREAM_RESET_OUTGOING_SSN | SCTP_STREAM_RESET_FAILED)); break; + case SCTP_NOTIFY_STR_RESET_DENIED_OUT: + sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), + (SCTP_STREAM_RESET_OUTGOING_SSN | SCTP_STREAM_RESET_DENIED)); + break; case SCTP_NOTIFY_STR_RESET_FAILED_IN: sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_FAILED)); break; + case SCTP_NOTIFY_STR_RESET_DENIED_IN: + sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), + (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_DENIED)); + break; case SCTP_NOTIFY_ASCONF_ADD_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data, error);