diff options
author | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2014-08-04 20:41:36 +0000 |
---|---|---|
committer | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2014-08-04 20:41:36 +0000 |
commit | 2344bfccffeb80545fca6a86e8cda3d56a6f50bf (patch) | |
tree | 9639a56bf4c89b9657fb0c8f6a8c5bb639389f9f | |
parent | 669cffca0ac8ad73a3c16bb63d1fa0f829f84c10 (diff) | |
download | usrsctplib-2344bfccffeb80545fca6a86e8cda3d56a6f50bf.tar.gz |
Sync with Mavericks sources.
git-svn-id: http://sctp-refimpl.googlecode.com/svn/trunk/KERN/usrsctp/usrsctplib@8955 9df1edf5-d72c-5b5f-11c0-5f5209eb73f7
-rwxr-xr-x | netinet/sctp.h | 3 | ||||
-rwxr-xr-x | netinet/sctp_input.c | 7 | ||||
-rwxr-xr-x | netinet/sctp_output.c | 11 | ||||
-rwxr-xr-x | netinet/sctp_pcb.c | 10 | ||||
-rwxr-xr-x | netinet/sctp_pcb.h | 3 | ||||
-rwxr-xr-x | netinet/sctp_peeloff.c | 4 | ||||
-rwxr-xr-x | netinet/sctp_structs.h | 5 | ||||
-rwxr-xr-x | netinet/sctp_sysctl.c | 12 | ||||
-rwxr-xr-x | netinet/sctp_sysctl.h | 11 | ||||
-rwxr-xr-x | netinet/sctp_usrreq.c | 64 | ||||
-rwxr-xr-x | netinet/sctputil.c | 5 | ||||
-rwxr-xr-x | user_socket.c | 2 | ||||
-rw-r--r-- | usrsctp.h | 1 |
13 files changed, 113 insertions, 25 deletions
diff --git a/netinet/sctp.h b/netinet/sctp.h index 6a81b27..d261312 100755 --- a/netinet/sctp.h +++ b/netinet/sctp.h @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 269527 2014-08-04 20:07:35Z tuexen $"); #endif #ifndef _NETINET_SCTP_H_ @@ -135,6 +135,7 @@ struct sctp_paramhdr { #define SCTP_PR_SUPPORTED 0x00000026 #define SCTP_NRSACK_SUPPORTED 0x00000027 #define SCTP_PKTDROP_SUPPORTED 0x00000028 +#define SCTP_RECONFIG_SUPPORTED 0x00000029 /* * read-only options diff --git a/netinet/sctp_input.c b/netinet/sctp_input.c index b3ee425..90d1cc0 100755 --- a/netinet/sctp_input.c +++ b/netinet/sctp_input.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -2928,6 +2928,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; + inp->reconfig_supported = (*inp_p)->reconfig_supported; inp->nrsack_supported = (*inp_p)->nrsack_supported; inp->pktdrop_supported = (*inp_p)->pktdrop_supported; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; @@ -5534,13 +5535,13 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, *offset = length; return (NULL); } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * hmm, peer should have announced this, but * we will turn it on since he is sending us * a stream reset. */ - stcb->asoc.peer_supports_strreset = 1; + stcb->asoc.reconfig_supported = 1; } if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ diff --git a/netinet/sctp_output.c b/netinet/sctp_output.c index 621e350..392e4e9 100755 --- a/netinet/sctp_output.c +++ b/netinet/sctp_output.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -5173,7 +5173,9 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked if (stcb->asoc.pktdrop_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; } - pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + if (stcb->asoc.reconfig_supported == 1) { + pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + } if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } @@ -6346,7 +6348,10 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, ((asoc == NULL) && (inp->pktdrop_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; } - pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + if (((asoc != NULL) && (asoc->reconfig_supported == 1)) || + ((asoc == NULL) && (inp->reconfig_supported == 1))) { + pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + } if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } diff --git a/netinet/sctp_pcb.c b/netinet/sctp_pcb.c index e57462e..57295fd 100755 --- a/netinet/sctp_pcb.c +++ b/netinet/sctp_pcb.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -2843,6 +2843,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_pr_enable); + inp->reconfig_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_reconfig_enable); inp->nrsack_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_nrsack_enable); inp->pktdrop_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_pktdrop_enable); #if defined(__Userspace__) @@ -7111,6 +7112,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, int got_random = 0, got_hmacs = 0, got_chklist = 0; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; #ifdef INET @@ -7142,9 +7144,9 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, } else { sa = src; } - /* Turn off ECN until we get through all params */ ecn_supported = 0; prsctp_supported = 0; + reconfig_supported = 0; nrsack_supported = 0; pktdrop_supported = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -7482,7 +7484,6 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, return (-25); } stcb->asoc.peer_supports_asconf = 0; - stcb->asoc.peer_supports_strreset = 0; stcb->asoc.peer_supports_auth = 0; pr_supported = (struct sctp_supported_chunk_types_param *)phdr; num_ent = plen - sizeof(struct sctp_paramhdr); @@ -7502,7 +7503,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, nrsack_supported = 1; break; case SCTP_STREAM_RESET: - stcb->asoc.peer_supports_strreset = 1; + reconfig_supported = 1; break; case SCTP_AUTHENTICATION: stcb->asoc.peer_supports_auth = 1; @@ -7644,6 +7645,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, } stcb->asoc.ecn_supported &= ecn_supported; stcb->asoc.prsctp_supported &= prsctp_supported; + stcb->asoc.reconfig_supported &= reconfig_supported; stcb->asoc.nrsack_supported &= nrsack_supported; stcb->asoc.pktdrop_supported &= pktdrop_supported; /* validate authentication required parameters */ diff --git a/netinet/sctp_pcb.h b/netinet/sctp_pcb.h index bf0f710..2206f9f 100755 --- a/netinet/sctp_pcb.h +++ b/netinet/sctp_pcb.h @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.h 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.h 269527 2014-08-04 20:07:35Z tuexen $"); #endif #ifndef _NETINET_SCTP_PCB_H_ @@ -482,6 +482,7 @@ struct sctp_inpcb { uint32_t sctp_cmt_on_off; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; struct sctp_nonpad_sndrcvinfo def_send; diff --git a/netinet/sctp_peeloff.c b/netinet/sctp_peeloff.c index 3421e1c..eb4809a 100755 --- a/netinet/sctp_peeloff.c +++ b/netinet/sctp_peeloff.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_peeloff.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_peeloff.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -127,6 +127,7 @@ sctp_do_peeloff(struct socket *head, struct socket *so, sctp_assoc_t assoc_id) n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->ecn_supported = inp->ecn_supported; n_inp->prsctp_supported = inp->prsctp_supported; + n_inp->reconfig_supported = inp->reconfig_supported; n_inp->nrsack_supported = inp->nrsack_supported; n_inp->pktdrop_supported = inp->pktdrop_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; @@ -239,6 +240,7 @@ sctp_get_peeloff(struct socket *head, sctp_assoc_t assoc_id, int *error) n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->ecn_supported = inp->ecn_supported; n_inp->prsctp_supported = inp->prsctp_supported; + n_inp->reconfig_supported = inp->reconfig_supported; n_inp->nrsack_supported = inp->nrsack_supported; n_inp->pktdrop_supported = inp->pktdrop_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; diff --git a/netinet/sctp_structs.h b/netinet/sctp_structs.h index cb728a7..1c42563 100755 --- a/netinet/sctp_structs.h +++ b/netinet/sctp_structs.h @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_structs.h 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_structs.h 269527 2014-08-04 20:07:35Z tuexen $"); #endif #ifndef _NETINET_SCTP_STRUCTS_H_ @@ -1203,6 +1203,7 @@ struct sctp_association { /* Flags whether an extension is supported or not */ uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; @@ -1213,8 +1214,6 @@ struct sctp_association { uint8_t peer_supports_asconf; /* peer authentication support flag */ uint8_t peer_supports_auth; - /* stream resets are supported by the peer */ - uint8_t peer_supports_strreset; uint8_t local_strreset_support; uint8_t peer_supports_nat; diff --git a/netinet/sctp_sysctl.c b/netinet/sctp_sysctl.c index 674551e..874fe56 100755 --- a/netinet/sctp_sysctl.c +++ b/netinet/sctp_sysctl.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -62,6 +62,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_reconfig_enable) = SCTPCTL_RECONFIG_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pktdrop_enable) = SCTPCTL_PKTDROP_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; @@ -774,6 +775,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #endif RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_reconfig_enable), SCTPCTL_RECONFIG_ENABLE_MIN, SCTPCTL_RECONFIG_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); @@ -1087,6 +1089,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pr_enable, CTLTYPE_UINT|CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_PR_ENABLE_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, reconfig_enable, CTLTYPE_UINT|CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_reconfig_enable), 0, sysctl_sctp_check, "IU", + SCTPCTL_RECONFIG_ENABLE_DESC); + #if defined(__FreeBSD__) && __FreeBSD_version < 1100000 SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, "IU", @@ -1440,6 +1446,10 @@ void sysctl_setup_sctp(void) &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, SCTPCTL_PR_ENABLE_DESC); + sysctl_add_oid(&sysctl_oid_top, "reconfig_enable", CTLTYPE_INT|CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_reconfig_enable), 0, sysctl_sctp_check, + SCTPCTL_RECONFIG_ENABLE_DESC); + sysctl_add_oid(&sysctl_oid_top, "nrsack_enable", CTLTYPE_INT|CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, SCTPCTL_NRSACK_ENABLE_DESC); diff --git a/netinet/sctp_sysctl.h b/netinet/sctp_sysctl.h index ce81666..6de8e7f 100755 --- a/netinet/sctp_sysctl.h +++ b/netinet/sctp_sysctl.h @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.h 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.h 269527 2014-08-04 20:07:35Z tuexen $"); #endif #ifndef _NETINET_SCTP_SYSCTL_H_ @@ -48,6 +48,7 @@ struct sctp_sysctl { uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; uint32_t sctp_pr_enable; + uint32_t sctp_reconfig_enable; uint32_t sctp_nrsack_enable; uint32_t sctp_pktdrop_enable; uint32_t sctp_fr_max_burst_default; @@ -178,8 +179,14 @@ struct sctp_sysctl { #define SCTPCTL_PR_ENABLE_MAX 1 #define SCTPCTL_PR_ENABLE_DEFAULT 1 +/* reconfig_enable: Enable SCTP RE-CONFIG */ +#define SCTPCTL_RECONFIG_ENABLE_DESC "Enable SCTP RE-CONFIG" +#define SCTPCTL_RECONFIG_ENABLE_MIN 0 +#define SCTPCTL_RECONFIG_ENABLE_MAX 1 +#define SCTPCTL_RECONFIG_ENABLE_DEFAULT 1 + /* nrsack_enable: Enable NR_SACK */ -#define SCTPCTL_NRSACK_ENABLE_DESC "Enable NR_SACK" +#define SCTPCTL_NRSACK_ENABLE_DESC "Enable SCTP NR-SACK" #define SCTPCTL_NRSACK_ENABLE_MIN 0 #define SCTPCTL_NRSACK_ENABLE_MAX 1 #define SCTPCTL_NRSACK_ENABLE_DEFAULT 0 diff --git a/netinet/sctp_usrreq.c b/netinet/sctp_usrreq.c index 76b3e71..739c8cf 100755 --- a/netinet/sctp_usrreq.c +++ b/netinet/sctp_usrreq.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -4056,6 +4056,33 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize, } break; } + case SCTP_RECONFIG_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.reconfig_supported; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->reconfig_supported; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_assoc_value); + } + break; + } case SCTP_NRSACK_SUPPORTED: { struct sctp_assoc_value *av; @@ -5095,7 +5122,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, error = ENOENT; break; } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * Peer does not support the chunk type. */ @@ -5162,7 +5189,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, error = ENOENT; break; } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * Peer does not support the chunk type. */ @@ -5228,7 +5255,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, error = ENOENT; break; } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * Peer does not support the chunk type. */ @@ -6928,6 +6955,35 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } break; } + case SCTP_RECONFIG_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + if (av->assoc_value == 0) { + inp->reconfig_supported = 0; + } else { + inp->reconfig_supported = 1; + } + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } case SCTP_NRSACK_SUPPORTED: { struct sctp_assoc_value *av; diff --git a/netinet/sctputil.c b/netinet/sctputil.c index e4f14f5..754a9ad 100755 --- a/netinet/sctputil.c +++ b/netinet/sctputil.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 269481 2014-08-03 18:12:55Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 269527 2014-08-04 20:07:35Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -974,6 +974,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off; asoc->ecn_supported = inp->ecn_supported; asoc->prsctp_supported = inp->prsctp_supported; + asoc->reconfig_supported = inp->reconfig_supported; asoc->nrsack_supported = inp->nrsack_supported; asoc->pktdrop_supported = inp->pktdrop_supported; asoc->sctp_cmt_pf = (uint8_t)0; @@ -2750,7 +2751,7 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; } sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; - if (stcb->asoc.peer_supports_strreset) { + if (stcb->asoc.reconfig_supported) { sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; } sac->sac_length += i; diff --git a/user_socket.c b/user_socket.c index 18b5d17..8810214 100755 --- a/user_socket.c +++ b/user_socket.c @@ -3248,6 +3248,7 @@ USRSCTP_SYSCTL_SET_DEF(sctp_auto_asconf) USRSCTP_SYSCTL_SET_DEF(sctp_multiple_asconfs) USRSCTP_SYSCTL_SET_DEF(sctp_ecn_enable) USRSCTP_SYSCTL_SET_DEF(sctp_pr_enable) +USRSCTP_SYSCTL_SET_DEF(sctp_reconfig_enable) USRSCTP_SYSCTL_SET_DEF(sctp_nrsack_enable) USRSCTP_SYSCTL_SET_DEF(sctp_pktdrop_enable) USRSCTP_SYSCTL_SET_DEF(sctp_strict_sacks) @@ -3328,6 +3329,7 @@ USRSCTP_SYSCTL_GET_DEF(sctp_auto_asconf) USRSCTP_SYSCTL_GET_DEF(sctp_multiple_asconfs) USRSCTP_SYSCTL_GET_DEF(sctp_ecn_enable) USRSCTP_SYSCTL_GET_DEF(sctp_pr_enable) +USRSCTP_SYSCTL_GET_DEF(sctp_reconfig_enable) USRSCTP_SYSCTL_GET_DEF(sctp_nrsack_enable) USRSCTP_SYSCTL_GET_DEF(sctp_pktdrop_enable) USRSCTP_SYSCTL_GET_DEF(sctp_strict_sacks) @@ -993,6 +993,7 @@ USRSCTP_SYSCTL_DECL(sctp_auto_asconf) USRSCTP_SYSCTL_DECL(sctp_multiple_asconfs) USRSCTP_SYSCTL_DECL(sctp_ecn_enable) USRSCTP_SYSCTL_DECL(sctp_pr_enable) +USRSCTP_SYSCTL_DECL(sctp_reconfig_enable) USRSCTP_SYSCTL_DECL(sctp_nrsack_enable) USRSCTP_SYSCTL_DECL(sctp_pktdrop_enable) USRSCTP_SYSCTL_DECL(sctp_strict_sacks) |