Lines Matching refs:inp

147 sctp_notify_mbuf(struct sctp_inpcb *inp,
158 if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
196 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
211 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
217 sctp_notify(struct sctp_inpcb *inp,
231 if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
284 so = SCTP_INP_SO(inp);
291 (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
328 struct sctp_inpcb *inp = NULL;
350 &inp, &net, 1, vrf_id);
351 if (stcb != NULL && inp && (inp->sctp_socket != NULL)) {
353 sctp_notify(inp, ip, sh,
358 sctp_notify_mbuf(inp, stcb, net, ip, sh);
361 if ((stcb == NULL) && (inp != NULL)) {
363 SCTP_INP_WLOCK(inp);
364 SCTP_INP_DECR_REF(inp);
365 SCTP_INP_WUNLOCK(inp);
382 struct sctp_inpcb *inp;
402 &inp, &net, 1, vrf_id);
403 if (stcb == NULL || inp == NULL || inp->sctp_socket == NULL) {
404 if ((inp != NULL) && (stcb == NULL)) {
406 SCTP_INP_WLOCK(inp);
407 SCTP_INP_DECR_REF(inp);
410 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
421 SCTP_INP_WLOCK(inp);
423 error = cr_canseesocket(req->td->td_ucred, inp->sctp_socket);
425 SCTP_INP_WUNLOCK(inp);
428 cru2x(inp->sctp_socket->so_cred, &xuc);
429 SCTP_INP_WUNLOCK(inp);
443 struct sctp_inpcb *inp;
446 inp = (struct sctp_inpcb *)so->so_pcb;
447 if (inp == NULL) {
451 flags = inp->sctp_flags;
453 sctp_log_closing(inp, NULL, 17);
456 (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) {
458 sctp_log_closing(inp, NULL, 16);
460 sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
474 flags = inp->sctp_flags;
485 struct sctp_inpcb *inp;
495 inp = (struct sctp_inpcb *)so->so_pcb;
496 if (inp != 0) {
497 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
510 inp = (struct sctp_inpcb *)so->so_pcb;
511 SCTP_INP_WLOCK(inp);
512 inp->sctp_flags &= ~SCTP_PCB_FLAGS_BOUND_V6; /* I'm not v6! */
513 ip_inp = &inp->ip_inp.inp;
519 sctp_log_closing(inp, NULL, 17);
523 flags = inp->sctp_flags;
525 (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) {
527 sctp_log_closing(inp, NULL, 15);
529 SCTP_INP_WUNLOCK(inp);
530 sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
533 flags = inp->sctp_flags;
537 SCTP_INP_WUNLOCK(inp);
543 SCTP_INP_WUNLOCK(inp);
550 struct sctp_inpcb *inp;
552 inp = (struct sctp_inpcb *)so->so_pcb;
553 if (inp == NULL) {
554 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
560 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
571 struct sctp_inpcb *inp;
574 inp = (struct sctp_inpcb *)so->so_pcb;
575 if (inp == NULL)
582 flags = inp->sctp_flags;
584 sctp_log_closing(inp, NULL, 17);
587 (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) {
591 sctp_log_closing(inp, NULL, 13);
593 sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
597 sctp_log_closing(inp, NULL, 14);
599 sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE,
618 flags = inp->sctp_flags;
636 struct sctp_inpcb *inp;
639 inp = (struct sctp_inpcb *)so->so_pcb;
640 if (inp == NULL) {
645 SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
651 ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) ||
652 (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE))) {
655 SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EDESTADDRREQ);
667 SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EDESTADDRREQ);
680 if (inp->control) {
682 sctp_m_freem(inp->control);
683 inp->control = NULL;
685 inp->control = control;
688 if (inp->pkt) {
689 SCTP_BUF_NEXT(inp->pkt_last) = m;
690 inp->pkt_last = m;
692 inp->pkt_last = inp->pkt = m;
708 ret = sctp_output(inp, inp->pkt, addr, inp->control, p, flags);
709 inp->pkt = NULL;
710 inp->control = NULL;
720 struct sctp_inpcb *inp;
722 inp = (struct sctp_inpcb *)so->so_pcb;
723 if (inp == NULL) {
724 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
727 SCTP_INP_RLOCK(inp);
728 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
729 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
730 if (LIST_EMPTY(&inp->sctp_asoc_list)) {
732 SCTP_INP_RUNLOCK(inp);
738 stcb = LIST_FIRST(&inp->sctp_asoc_list);
740 SCTP_INP_RUNLOCK(inp);
741 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
749 SCTP_INP_RUNLOCK(inp);
776 SCTP_INP_RUNLOCK(inp);
781 (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
866 SCTP_INP_RUNLOCK(inp);
867 (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
871 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED);
876 SCTP_INP_RUNLOCK(inp);
882 SCTP_INP_RUNLOCK(inp);
883 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
897 struct sctp_inpcb *inp;
899 inp = (struct sctp_inpcb *)so->so_pcb;
900 if (inp == NULL) {
901 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
904 SCTP_INP_RLOCK(inp);
906 if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
907 SCTP_INP_RUNLOCK(inp);
910 SCTP_INP_RUNLOCK(inp);
916 SCTP_INP_WLOCK(inp);
917 SCTP_INP_READ_LOCK(inp);
918 inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ;
919 SCTP_INP_READ_UNLOCK(inp);
920 SCTP_INP_WUNLOCK(inp);
941 struct sctp_inpcb *inp;
943 inp = (struct sctp_inpcb *)so->so_pcb;
944 if (inp == NULL) {
945 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
948 SCTP_INP_RLOCK(inp);
950 if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
951 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) {
957 SCTP_INP_RUNLOCK(inp);
958 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
971 SCTP_INP_RUNLOCK(inp);
976 stcb = LIST_FIRST(&inp->sctp_asoc_list);
983 SCTP_INP_RUNLOCK(inp);
1061 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED);
1067 SCTP_INP_RUNLOCK(inp);
1094 sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp,
1141 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
1146 if (SCTP_IPV6_V6ONLY(inp)) {
1165 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
1202 if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
1211 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) {
1213 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1219 ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport;
1247 if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
1278 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1298 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
1309 ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport;
1314 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1333 sctp_fill_up_addresses(struct sctp_inpcb *inp,
1342 size = sctp_fill_up_addresses_vrf(inp, stcb, limit, sas,
1343 inp->def_vrf_id);
1352 sctp_count_max_addresses_vrf(struct sctp_inpcb *inp, uint32_t vrf_id)
1368 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
1379 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4))
1401 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
1406 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4))
1429 sctp_count_max_addresses(struct sctp_inpcb *inp)
1435 cnt = sctp_count_max_addresses_vrf(inp, inp->def_vrf_id);
1441 sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
1455 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
1456 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
1458 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE);
1461 if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) &&
1462 (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE))) {
1463 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1466 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1467 SCTP_INP_RLOCK(inp);
1468 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1469 SCTP_INP_RUNLOCK(inp);
1472 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
1475 SCTP_INP_INCR_REF(inp);
1476 SCTP_ASOC_CREATE_LOCK(inp);
1478 if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) ||
1479 (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) {
1480 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EFAULT);
1487 stcb = sctp_connectx_helper_find(inp, sa, &totaddr, &num_v4, &num_v6, &error, (optsize - sizeof(int)), &bad_addresses);
1490 SCTP_ASOC_CREATE_UNLOCK(inp);
1495 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
1501 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) &&
1506 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
1510 inp6 = (struct in6pcb *)inp;
1516 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1522 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
1531 vrf_id = inp->def_vrf_id;
1535 stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id,
1568 (void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE,
1576 sctp_initialize_auth_params(inp, stcb);
1581 sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, stcb->asoc.primary_destination);
1584 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
1594 SCTP_ASOC_CREATE_UNLOCK(inp);
1596 SCTP_INP_DECR_REF(inp);
1600 #define SCTP_FIND_STCB(inp, stcb, assoc_id) { \
1601 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||\
1602 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { \
1603 SCTP_INP_RLOCK(inp); \
1604 stcb = LIST_FIRST(&inp->sctp_asoc_list); \
1608 SCTP_INP_RUNLOCK(inp); \
1610 stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); \
1612 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); \
1624 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); \
1636 struct sctp_inpcb *inp = NULL;
1641 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1644 inp = (struct sctp_inpcb *)so->so_pcb;
1645 if (inp == NULL) {
1646 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1659 SCTP_INP_RLOCK(inp);
1662 val = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NO_FRAGMENT);
1665 val = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4);
1668 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
1670 val = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTO_ASCONF);
1672 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1678 val = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR);
1681 val = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY);
1684 val = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO);
1687 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))
1688 val = TICKS_TO_SEC(inp->sctp_ep.auto_close_time);
1694 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
1698 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1702 SCTP_INP_RUNLOCK(inp);
1719 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
1728 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) {
1734 *value = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE);
1743 *value = inp->partial_delivery_point;
1752 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE)) {
1753 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_INTERLEAVE_STRMS)) {
1769 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
1774 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
1775 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
1777 SCTP_INP_RLOCK(inp);
1778 av->assoc_value = inp->sctp_cmt_on_off;
1779 SCTP_INP_RUNLOCK(inp);
1781 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1795 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
1800 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
1801 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
1803 SCTP_INP_RLOCK(inp);
1804 av->assoc_value = inp->sctp_ep.sctp_default_cc_module;
1805 SCTP_INP_RUNLOCK(inp);
1807 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1821 SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id);
1840 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
1845 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
1846 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
1848 SCTP_INP_RLOCK(inp);
1849 av->assoc_value = inp->sctp_ep.sctp_default_ss_module;
1850 SCTP_INP_RUNLOCK(inp);
1852 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1866 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
1871 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1882 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1906 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
1918 SCTP_INP_RLOCK(inp);
1919 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
1922 SCTP_INP_RUNLOCK(inp);
1935 SCTP_INP_RLOCK(inp);
1936 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
1941 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
1945 SCTP_INP_RUNLOCK(inp);
1957 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
1963 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
1964 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
1966 SCTP_INP_RLOCK(inp);
1967 av->assoc_value = inp->sctp_context;
1968 SCTP_INP_RUNLOCK(inp);
1970 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
1984 *default_vrfid = inp->def_vrf_id;
1993 SCTP_FIND_STCB(inp, stcb, id->assoc_id);
1996 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
2005 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
2014 SCTP_FIND_STCB(inp, stcb, gnv->gn_assoc_id);
2022 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
2032 SCTP_FIND_STCB(inp, stcb, sack->sack_assoc_id);
2038 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2039 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2041 SCTP_INP_RLOCK(inp);
2042 sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]);
2043 sack->sack_freq = inp->sctp_ep.sctp_sack_freq;
2044 SCTP_INP_RUNLOCK(inp);
2046 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2060 SCTP_FIND_STCB(inp, stcb, ss->ss_assoc_id);
2069 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
2079 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
2085 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2086 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2088 SCTP_INP_RLOCK(inp);
2089 av->assoc_value = inp->sctp_ep.max_burst;
2090 SCTP_INP_RUNLOCK(inp);
2092 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2107 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
2113 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2114 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2116 SCTP_INP_RLOCK(inp);
2117 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
2122 if (inp->sctp_frag_point >= SCTP_DEFAULT_MAXSEGMENT)
2125 av->assoc_value = inp->sctp_frag_point - ovh;
2126 SCTP_INP_RUNLOCK(inp);
2128 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2146 SCTP_INP_RLOCK(inp);
2147 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT))
2150 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVASSOCEVNT))
2153 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVPADDREVNT))
2156 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVSENDFAILEVNT))
2159 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVPEERERR))
2162 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT))
2165 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PDAPIEVNT))
2168 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ADAPTATIONEVNT))
2171 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTHEVNT))
2174 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_DRYEVNT))
2177 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_STREAM_RESETEVNT))
2179 SCTP_INP_RUNLOCK(inp);
2189 SCTP_INP_RLOCK(inp);
2190 *value = inp->sctp_ep.adaptation_layer_indicator;
2191 SCTP_INP_RUNLOCK(inp);
2200 SCTP_INP_RLOCK(inp);
2201 *value = inp->sctp_ep.initial_sequence_debug;
2202 SCTP_INP_RUNLOCK(inp);
2211 SCTP_INP_RLOCK(inp);
2212 *value = sctp_count_max_addresses(inp);
2213 SCTP_INP_RUNLOCK(inp);
2225 SCTP_FIND_STCB(inp, stcb, (sctp_assoc_t) * value);
2235 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) {
2258 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
2275 SCTP_FIND_STCB(inp, stcb, saddr->sget_assoc_id);
2287 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) {
2314 if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) &&
2333 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
2345 SCTP_FIND_STCB(inp, stcb, saddr->sget_assoc_id);
2349 actual = sctp_fill_up_addresses(inp, stcb, limit, sas);
2368 SCTP_FIND_STCB(inp, stcb, paddrp->spp_assoc_id);
2398 SCTP_INP_INCR_REF(inp);
2399 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
2401 SCTP_INP_DECR_REF(inp);
2413 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
2426 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
2434 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
2500 if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) {
2505 if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) {
2515 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2516 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2519 SCTP_INP_RLOCK(inp);
2520 paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure;
2521 paddrp->spp_hbinterval = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]);
2523 /* get inp's default */
2524 if (inp->sctp_ep.default_dscp & 0x01) {
2525 paddrp->spp_dscp = inp->sctp_ep.default_dscp & 0xfc;
2529 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
2530 (inp->sctp_ep.default_flowlabel & 0x80000000)) {
2531 paddrp->spp_ipv6_flowlabel = inp->sctp_ep.default_flowlabel & 0x000fffff;
2538 if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) {
2543 if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) {
2548 SCTP_INP_RUNLOCK(inp);
2550 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2571 SCTP_FIND_STCB(inp, stcb, paddri->spinfo_assoc_id);
2601 SCTP_INP_INCR_REF(inp);
2602 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
2604 SCTP_INP_DECR_REF(inp);
2644 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
2664 SCTP_FIND_STCB(inp, stcb, sstat->sstat_assoc_id);
2667 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2738 SCTP_FIND_STCB(inp, stcb, srto->srto_assoc_id);
2746 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2747 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2749 SCTP_INP_RLOCK(inp);
2750 srto->srto_initial = inp->sctp_ep.initial_rto;
2751 srto->srto_max = inp->sctp_ep.sctp_maxrto;
2752 srto->srto_min = inp->sctp_ep.sctp_minrto;
2753 SCTP_INP_RUNLOCK(inp);
2755 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2769 SCTP_FIND_STCB(inp, stcb, stimo->stimo_assoc_id);
2782 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2792 SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
2802 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2803 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2805 SCTP_INP_RLOCK(inp);
2806 sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life);
2807 sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times;
2810 sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv);
2811 SCTP_INP_RUNLOCK(inp);
2813 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2827 SCTP_FIND_STCB(inp, stcb, s_info->sinfo_assoc_id);
2833 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2834 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2836 SCTP_INP_RLOCK(inp);
2837 memcpy(s_info, &inp->def_send, sizeof(inp->def_send));
2838 SCTP_INP_RUNLOCK(inp);
2840 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2854 SCTP_INP_RLOCK(inp);
2855 sinit->sinit_num_ostreams = inp->sctp_ep.pre_open_stream_count;
2856 sinit->sinit_max_instreams = inp->sctp_ep.max_open_streams_intome;
2857 sinit->sinit_max_attempts = inp->sctp_ep.max_init_times;
2858 sinit->sinit_max_init_timeo = inp->sctp_ep.initial_init_rto_max;
2859 SCTP_INP_RUNLOCK(inp);
2869 SCTP_FIND_STCB(inp, stcb, ssp->ssp_assoc_id);
2879 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) {
2901 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2915 SCTP_INP_RLOCK(inp);
2916 hmaclist = inp->sctp_ep.local_hmacs;
2920 SCTP_INP_RUNLOCK(inp);
2927 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2929 SCTP_INP_RUNLOCK(inp);
2937 SCTP_INP_RUNLOCK(inp);
2946 SCTP_FIND_STCB(inp, stcb, scact->scact_assoc_id);
2953 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2954 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2957 SCTP_INP_RLOCK(inp);
2958 scact->scact_keynumber = inp->sctp_ep.default_keyid;
2959 SCTP_INP_RUNLOCK(inp);
2961 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
2977 SCTP_FIND_STCB(inp, stcb, sac->gauth_assoc_id);
2986 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
2995 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
2996 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
2999 SCTP_INP_RLOCK(inp);
3000 chklist = inp->sctp_ep.local_auth_chunks;
3005 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3012 SCTP_INP_RUNLOCK(inp);
3014 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3027 SCTP_FIND_STCB(inp, stcb, sac->gauth_assoc_id);
3036 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3045 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
3056 SCTP_FIND_STCB(inp, stcb, event->se_assoc_id);
3091 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP);
3105 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3111 event->se_on = sctp_stcb_is_feature_on(inp, stcb, event_type);
3114 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3115 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3117 SCTP_INP_RLOCK(inp);
3118 event->se_on = sctp_is_feature_on(inp, event_type);
3119 SCTP_INP_RUNLOCK(inp);
3121 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3136 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3139 SCTP_INP_RLOCK(inp);
3140 onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO);
3141 SCTP_INP_RUNLOCK(inp);
3155 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3158 SCTP_INP_RLOCK(inp);
3159 onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO);
3160 SCTP_INP_RUNLOCK(inp);
3174 SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id);
3184 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3185 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3187 SCTP_INP_RLOCK(inp);
3188 info->snd_sid = inp->def_send.sinfo_stream;
3189 info->snd_flags = inp->def_send.sinfo_flags;
3191 info->snd_ppid = inp->def_send.sinfo_ppid;
3192 info->snd_context = inp->def_send.sinfo_context;
3193 SCTP_INP_RUNLOCK(inp);
3195 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3209 SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id);
3216 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3217 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3219 SCTP_INP_RLOCK(inp);
3220 info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags);
3221 info->pr_value = inp->def_send.sinfo_timetolive;
3222 SCTP_INP_RUNLOCK(inp);
3224 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3245 SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id);
3275 SCTP_INP_INCR_REF(inp);
3276 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
3278 SCTP_INP_DECR_REF(inp);
3290 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3303 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3311 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3326 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3327 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3330 SCTP_INP_RLOCK(inp);
3331 thlds->spt_pathmaxrxt = inp->sctp_ep.def_net_failure;
3332 thlds->spt_pathpfthld = inp->sctp_ep.def_net_pf_threshold;
3333 SCTP_INP_RUNLOCK(inp);
3335 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3356 SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id);
3386 SCTP_INP_INCR_REF(inp);
3387 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
3389 SCTP_INP_DECR_REF(inp);
3401 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3414 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3422 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
3434 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3435 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3437 SCTP_INP_RLOCK(inp);
3438 encaps->sue_port = inp->sctp_ep.port;
3439 SCTP_INP_RUNLOCK(inp);
3441 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3455 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3461 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3462 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3464 SCTP_INP_RLOCK(inp);
3465 av->assoc_value = inp->ecn_supported;
3466 SCTP_INP_RUNLOCK(inp);
3468 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3482 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3488 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3489 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3491 SCTP_INP_RLOCK(inp);
3492 av->assoc_value = inp->prsctp_supported;
3493 SCTP_INP_RUNLOCK(inp);
3495 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3509 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3515 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3516 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3518 SCTP_INP_RLOCK(inp);
3519 av->assoc_value = inp->auth_supported;
3520 SCTP_INP_RUNLOCK(inp);
3522 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3536 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3542 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3543 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3545 SCTP_INP_RLOCK(inp);
3546 av->assoc_value = inp->asconf_supported;
3547 SCTP_INP_RUNLOCK(inp);
3549 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3563 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3569 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3570 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3572 SCTP_INP_RLOCK(inp);
3573 av->assoc_value = inp->reconfig_supported;
3574 SCTP_INP_RUNLOCK(inp);
3576 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3590 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3596 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3597 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3599 SCTP_INP_RLOCK(inp);
3600 av->assoc_value = inp->nrsack_supported;
3601 SCTP_INP_RUNLOCK(inp);
3603 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3617 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3623 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3624 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3626 SCTP_INP_RLOCK(inp);
3627 av->assoc_value = inp->pktdrop_supported;
3628 SCTP_INP_RUNLOCK(inp);
3630 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3644 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3650 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3651 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3653 SCTP_INP_RLOCK(inp);
3654 av->assoc_value = (uint32_t) inp->local_strreset_support;
3655 SCTP_INP_RUNLOCK(inp);
3657 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3673 SCTP_FIND_STCB(inp, stcb, sprstat->sprstat_assoc_id);
3700 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3711 SCTP_FIND_STCB(inp, stcb, sprstat->sprstat_assoc_id);
3728 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3738 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3744 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3745 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3747 SCTP_INP_RLOCK(inp);
3748 av->assoc_value = inp->max_cwnd;
3749 SCTP_INP_RUNLOCK(inp);
3751 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3761 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
3778 struct sctp_inpcb *inp = NULL;
3783 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3786 inp = (struct sctp_inpcb *)so->so_pcb;
3787 if (inp == NULL) {
3788 SCTP_PRINTF("inp is NULL?\n");
3789 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3792 vrf_id = inp->def_vrf_id;
3816 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3821 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EPERM);
3826 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3837 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
3840 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3848 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3849 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
3850 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3858 inp->sctp_ep.auto_close_time = SEC_TO_TICKS(*mopt);
3861 SCTP_INP_WLOCK(inp);
3863 sctp_feature_on(inp, set_opt);
3865 sctp_feature_off(inp, set_opt);
3867 SCTP_INP_WUNLOCK(inp);
3872 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) == 0) {
3877 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) {
3883 sctp_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE);
3885 sctp_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE);
3894 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3898 inp->partial_delivery_point = *value;
3908 sctp_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE);
3909 sctp_feature_on(inp, SCTP_PCB_FLAGS_INTERLEAVE_STRMS);
3911 sctp_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE);
3912 sctp_feature_off(inp, SCTP_PCB_FLAGS_INTERLEAVE_STRMS);
3914 sctp_feature_off(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE);
3915 sctp_feature_off(inp, SCTP_PCB_FLAGS_INTERLEAVE_STRMS);
3918 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3929 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3933 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3938 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3939 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3942 SCTP_INP_WLOCK(inp);
3943 inp->sctp_cmt_on_off = av->assoc_value;
3944 SCTP_INP_WUNLOCK(inp);
3948 SCTP_INP_RLOCK(inp);
3949 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
3954 SCTP_INP_RUNLOCK(inp);
3958 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
3972 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
3976 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
3987 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
3988 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
3991 SCTP_INP_WLOCK(inp);
3992 inp->sctp_ep.sctp_default_cc_module = av->assoc_value;
3993 SCTP_INP_WUNLOCK(inp);
3997 SCTP_INP_RLOCK(inp);
3998 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4009 SCTP_INP_RUNLOCK(inp);
4019 SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id);
4022 SCTP_INP_RLOCK(inp);
4023 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4030 SCTP_INP_RUNLOCK(inp);
4056 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4060 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
4068 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4069 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4072 SCTP_INP_WLOCK(inp);
4073 inp->sctp_ep.sctp_default_ss_module = av->assoc_value;
4074 SCTP_INP_WUNLOCK(inp);
4078 SCTP_INP_RLOCK(inp);
4079 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4087 SCTP_INP_RUNLOCK(inp);
4097 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
4102 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4108 SCTP_INP_RLOCK(inp);
4109 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4119 SCTP_INP_RUNLOCK(inp);
4125 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4132 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
4140 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
4146 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4147 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4150 SCTP_INP_WLOCK(inp);
4151 inp->sctp_context = av->assoc_value;
4152 SCTP_INP_WUNLOCK(inp);
4156 SCTP_INP_RLOCK(inp);
4157 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4162 SCTP_INP_RUNLOCK(inp);
4173 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4177 inp->def_vrf_id = *default_vrfid;
4182 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
4188 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
4197 SCTP_FIND_STCB(inp, stcb, sack->sack_assoc_id);
4214 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4215 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4218 SCTP_INP_WLOCK(inp);
4220 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV] = MSEC_TO_TICKS(sack->sack_delay);
4223 inp->sctp_ep.sctp_sack_freq = sack->sack_freq;
4225 SCTP_INP_WUNLOCK(inp);
4229 SCTP_INP_RLOCK(inp);
4230 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4240 SCTP_INP_RUNLOCK(inp);
4251 SCTP_INP_WLOCK(inp);
4252 if (sctp_auth_add_chunk(sauth->sauth_chunk, inp->sctp_ep.local_auth_chunks)) {
4253 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4256 SCTP_INP_WUNLOCK(inp);
4274 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4279 SCTP_FIND_STCB(inp, stcb, sca->sca_assoc_id);
4292 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
4301 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
4311 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4312 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4315 SCTP_INP_WLOCK(inp);
4316 shared_keys = &inp->sctp_ep.shared_keys;
4321 sctp_clear_cachedkeys_ep(inp, sca->sca_keynumber);
4329 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
4331 SCTP_INP_WUNLOCK(inp);
4338 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
4340 SCTP_INP_WUNLOCK(inp);
4346 SCTP_INP_WUNLOCK(inp);
4350 SCTP_INP_RLOCK(inp);
4351 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4381 SCTP_INP_RUNLOCK(inp);
4396 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4402 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
4410 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4425 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4430 SCTP_INP_WLOCK(inp);
4431 if (inp->sctp_ep.local_hmacs)
4432 sctp_free_hmaclist(inp->sctp_ep.local_hmacs);
4433 inp->sctp_ep.local_hmacs = hmaclist;
4434 SCTP_INP_WUNLOCK(inp);
4443 SCTP_FIND_STCB(inp, stcb, scact->scact_assoc_id);
4450 SCTP_LTRACE_ERR_RET(inp, NULL, NULL,
4457 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4458 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4461 SCTP_INP_WLOCK(inp);
4462 if (sctp_auth_setactivekey_ep(inp, scact->scact_keynumber)) {
4463 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4466 SCTP_INP_WUNLOCK(inp);
4470 SCTP_INP_RLOCK(inp);
4471 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4476 SCTP_INP_RUNLOCK(inp);
4486 SCTP_FIND_STCB(inp, stcb, scdel->scact_assoc_id);
4491 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4496 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4497 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4500 SCTP_INP_WLOCK(inp);
4501 if (sctp_delete_sharedkey_ep(inp, scdel->scact_keynumber)) {
4502 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4505 SCTP_INP_WUNLOCK(inp);
4509 SCTP_INP_RLOCK(inp);
4510 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4515 SCTP_INP_RUNLOCK(inp);
4525 SCTP_FIND_STCB(inp, stcb, keyid->scact_assoc_id);
4530 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4535 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4536 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4539 SCTP_INP_WLOCK(inp);
4540 if (sctp_deact_sharedkey_ep(inp, keyid->scact_keynumber)) {
4541 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4544 SCTP_INP_WUNLOCK(inp);
4548 SCTP_INP_RLOCK(inp);
4549 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4554 SCTP_INP_RUNLOCK(inp);
4565 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4569 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
4574 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4575 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4578 SCTP_INP_WLOCK(inp);
4579 inp->local_strreset_support = (uint8_t) av->assoc_value;
4580 SCTP_INP_WUNLOCK(inp);
4584 SCTP_INP_RLOCK(inp);
4585 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4590 SCTP_INP_RUNLOCK(inp);
4602 SCTP_FIND_STCB(inp, stcb, strrst->srs_assoc_id);
4604 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
4612 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
4624 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
4636 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4644 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4650 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4663 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
4675 SCTP_FIND_STCB(inp, stcb, stradd->sas_assoc_id);
4677 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
4685 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
4691 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
4734 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
4744 SCTP_FIND_STCB(inp, stcb, (sctp_assoc_t) * value);
4746 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
4754 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
4760 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
4766 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
4772 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4776 error = sctp_do_connect_x(so, inp, optval, optsize, p, 0);
4780 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4784 error = sctp_do_connect_x(so, inp, optval, optsize, p, 1);
4794 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
4795 SCTP_INP_RLOCK(inp);
4796 stcb = LIST_FIRST(&inp->sctp_asoc_list);
4800 SCTP_INP_RUNLOCK(inp);
4809 SCTP_INP_INCR_REF(inp);
4810 stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL);
4812 SCTP_INP_DECR_REF(inp);
4817 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
4824 sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb,
4827 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
4833 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
4844 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
4850 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4851 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4854 SCTP_INP_WLOCK(inp);
4855 inp->sctp_ep.max_burst = av->assoc_value;
4856 SCTP_INP_WUNLOCK(inp);
4860 SCTP_INP_RLOCK(inp);
4861 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4866 SCTP_INP_RUNLOCK(inp);
4877 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
4879 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
4892 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
4893 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
4895 SCTP_INP_WLOCK(inp);
4901 inp->sctp_frag_point = (av->assoc_value + ovh);
4903 inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT;
4905 SCTP_INP_WUNLOCK(inp);
4907 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
4919 SCTP_INP_WLOCK(inp);
4921 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT);
4923 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT);
4927 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVASSOCEVNT);
4929 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVASSOCEVNT);
4933 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVPADDREVNT);
4935 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVPADDREVNT);
4939 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVSENDFAILEVNT);
4941 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVSENDFAILEVNT);
4945 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVPEERERR);
4947 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVPEERERR);
4951 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT);
4953 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT);
4957 sctp_feature_on(inp, SCTP_PCB_FLAGS_PDAPIEVNT);
4959 sctp_feature_off(inp, SCTP_PCB_FLAGS_PDAPIEVNT);
4963 sctp_feature_on(inp, SCTP_PCB_FLAGS_ADAPTATIONEVNT);
4965 sctp_feature_off(inp, SCTP_PCB_FLAGS_ADAPTATIONEVNT);
4969 sctp_feature_on(inp, SCTP_PCB_FLAGS_AUTHEVNT);
4971 sctp_feature_off(inp, SCTP_PCB_FLAGS_AUTHEVNT);
4975 sctp_feature_on(inp, SCTP_PCB_FLAGS_DRYEVNT);
4977 sctp_feature_off(inp, SCTP_PCB_FLAGS_DRYEVNT);
4981 sctp_feature_on(inp, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
4983 sctp_feature_off(inp, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
4985 SCTP_INP_WUNLOCK(inp);
4987 SCTP_INP_RLOCK(inp);
4988 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4991 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT);
4993 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT);
4996 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT);
4998 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT);
5001 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT);
5003 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT);
5006 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVPEERERR);
5008 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVPEERERR);
5011 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT);
5013 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT);
5016 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_PDAPIEVNT);
5018 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_PDAPIEVNT);
5021 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT);
5023 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT);
5026 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_AUTHEVNT);
5028 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_AUTHEVNT);
5031 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DRYEVNT);
5033 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DRYEVNT);
5036 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
5038 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
5047 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
5048 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
5049 stcb = LIST_FIRST(&inp->sctp_asoc_list);
5061 SCTP_INP_RUNLOCK(inp);
5069 SCTP_INP_WLOCK(inp);
5070 inp->sctp_ep.adaptation_layer_indicator = adap_bits->ssb_adaptation_ind;
5071 inp->sctp_ep.adaptation_layer_indicator_provided = 1;
5072 SCTP_INP_WUNLOCK(inp);
5081 SCTP_INP_WLOCK(inp);
5082 inp->sctp_ep.initial_sequence_debug = *vvv;
5083 SCTP_INP_WUNLOCK(inp);
5092 SCTP_FIND_STCB(inp, stcb, s_info->sinfo_assoc_id);
5098 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5103 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
5104 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
5107 SCTP_INP_WLOCK(inp);
5108 memcpy(&inp->def_send, s_info, min(optsize, sizeof(inp->def_send)));
5109 SCTP_INP_WUNLOCK(inp);
5113 SCTP_INP_RLOCK(inp);
5114 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
5121 SCTP_INP_RUNLOCK(inp);
5138 SCTP_FIND_STCB(inp, stcb, paddrp->spp_assoc_id);
5168 SCTP_INP_INCR_REF(inp);
5169 stcb = sctp_findassociation_ep_addr(&inp, addr,
5172 SCTP_INP_DECR_REF(inp);
5183 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5196 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5206 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
5214 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5220 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5230 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
5241 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
5243 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
5249 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
5250 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
5254 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
5279 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
5374 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
5376 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
5378 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
5386 inp, stcb, net,
5391 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
5396 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
5419 sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD);
5424 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
5428 sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD);
5454 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
5455 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
5457 SCTP_INP_WLOCK(inp);
5464 inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt;
5467 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0;
5471 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval);
5475 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0;
5477 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval);
5479 sctp_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
5481 sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
5484 sctp_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD);
5486 sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD);
5489 inp->sctp_ep.default_dscp = paddrp->spp_dscp & 0xfc;
5490 inp->sctp_ep.default_dscp |= 0x01;
5494 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
5495 inp->sctp_ep.default_flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff;
5496 inp->sctp_ep.default_flowlabel |= 0x80000000;
5500 SCTP_INP_WUNLOCK(inp);
5502 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5514 SCTP_FIND_STCB(inp, stcb, srto->srto_assoc_id);
5534 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5539 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
5540 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
5542 SCTP_INP_WLOCK(inp);
5546 new_init = inp->sctp_ep.initial_rto;
5550 new_max = inp->sctp_ep.sctp_maxrto;
5554 new_min = inp->sctp_ep.sctp_minrto;
5556 inp->sctp_ep.initial_rto = new_init;
5557 inp->sctp_ep.sctp_maxrto = new_max;
5558 inp->sctp_ep.sctp_minrto = new_min;
5560 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5563 SCTP_INP_WUNLOCK(inp);
5565 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5576 SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
5593 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
5594 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
5596 SCTP_INP_WLOCK(inp);
5598 inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt;
5600 inp->sctp_ep.def_cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
5602 SCTP_INP_WUNLOCK(inp);
5604 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5615 SCTP_INP_WLOCK(inp);
5617 inp->sctp_ep.pre_open_stream_count = sinit->sinit_num_ostreams;
5620 inp->sctp_ep.max_open_streams_intome = sinit->sinit_max_instreams;
5623 inp->sctp_ep.max_init_times = sinit->sinit_max_attempts;
5626 inp->sctp_ep.initial_init_rto_max = sinit->sinit_max_init_timeo;
5627 SCTP_INP_WUNLOCK(inp);
5642 SCTP_FIND_STCB(inp, stcb, spa->ssp_assoc_id);
5672 SCTP_INP_INCR_REF(inp);
5673 stcb = sctp_findassociation_ep_addr(&inp, addr,
5676 SCTP_INP_DECR_REF(inp);
5692 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5696 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5701 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5734 SCTP_FIND_STCB(inp, stcb, sspp->sspp_assoc_id);
5757 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5761 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
5769 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
5781 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5793 if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
5795 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5808 if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
5810 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5818 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5824 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5830 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5846 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5851 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error);
5859 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5864 (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) {
5865 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error);
5874 sctp_bindx_add_address(so, inp, addrs->addr,
5890 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5895 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error);
5903 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5910 (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) {
5911 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error);
5920 sctp_bindx_delete_address(inp, addrs->addr,
5931 SCTP_FIND_STCB(inp, stcb, event->se_assoc_id);
5965 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP);
5979 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
5986 sctp_stcb_feature_on(inp, stcb, event_type);
5995 sctp_stcb_feature_off(inp, stcb, event_type);
6005 ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) == 0) &&
6006 ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0) &&
6009 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP);
6013 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6014 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6017 SCTP_INP_WLOCK(inp);
6019 sctp_feature_on(inp, event_type);
6021 sctp_feature_off(inp, event_type);
6023 SCTP_INP_WUNLOCK(inp);
6027 SCTP_INP_RLOCK(inp);
6028 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
6031 sctp_stcb_feature_on(inp, stcb, event_type);
6033 sctp_stcb_feature_off(inp, stcb, event_type);
6037 SCTP_INP_RUNLOCK(inp);
6048 SCTP_INP_WLOCK(inp);
6050 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO);
6052 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO);
6054 SCTP_INP_WUNLOCK(inp);
6062 SCTP_INP_WLOCK(inp);
6064 sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO);
6066 sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO);
6068 SCTP_INP_WUNLOCK(inp);
6077 SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id);
6088 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6093 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6094 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6097 SCTP_INP_WLOCK(inp);
6098 inp->def_send.sinfo_stream = info->snd_sid;
6099 policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags);
6100 inp->def_send.sinfo_flags = info->snd_flags;
6101 inp->def_send.sinfo_flags |= policy;
6102 inp->def_send.sinfo_ppid = info->snd_ppid;
6103 inp->def_send.sinfo_context = info->snd_context;
6104 SCTP_INP_WUNLOCK(inp);
6108 SCTP_INP_RLOCK(inp);
6109 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
6121 SCTP_INP_RUNLOCK(inp);
6131 SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id);
6134 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6144 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6145 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6148 SCTP_INP_WLOCK(inp);
6149 inp->def_send.sinfo_flags &= 0xfff0;
6150 inp->def_send.sinfo_flags |= info->pr_policy;
6151 inp->def_send.sinfo_timetolive = info->pr_value;
6152 SCTP_INP_WUNLOCK(inp);
6156 SCTP_INP_RLOCK(inp);
6157 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
6164 SCTP_INP_RUNLOCK(inp);
6182 SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id);
6212 SCTP_INP_INCR_REF(inp);
6213 stcb = sctp_findassociation_ep_addr(&inp, addr,
6216 SCTP_INP_DECR_REF(inp);
6227 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6240 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6250 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
6322 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6323 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6325 SCTP_INP_WLOCK(inp);
6326 inp->sctp_ep.def_net_failure = thlds->spt_pathmaxrxt;
6327 inp->sctp_ep.def_net_pf_threshold = thlds->spt_pathpfthld;
6328 SCTP_INP_WUNLOCK(inp);
6330 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6348 SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id);
6378 SCTP_INP_INCR_REF(inp);
6379 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
6381 SCTP_INP_DECR_REF(inp);
6392 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6405 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6415 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
6427 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6428 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6430 SCTP_INP_WLOCK(inp);
6431 inp->sctp_ep.port = encaps->sue_port;
6432 SCTP_INP_WUNLOCK(inp);
6434 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6445 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6448 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6452 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6453 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6455 SCTP_INP_WLOCK(inp);
6457 inp->ecn_supported = 0;
6459 inp->ecn_supported = 1;
6461 SCTP_INP_WUNLOCK(inp);
6463 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6474 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6477 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6481 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6482 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6484 SCTP_INP_WLOCK(inp);
6486 inp->prsctp_supported = 0;
6488 inp->prsctp_supported = 1;
6490 SCTP_INP_WUNLOCK(inp);
6492 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6503 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6506 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6510 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6511 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6514 (inp->asconf_supported == 1)) {
6519 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6522 SCTP_INP_WLOCK(inp);
6524 inp->auth_supported = 0;
6526 inp->auth_supported = 1;
6528 SCTP_INP_WUNLOCK(inp);
6531 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6542 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6545 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6549 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6550 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6553 (inp->auth_supported == 0)) {
6558 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6561 SCTP_INP_WLOCK(inp);
6563 inp->asconf_supported = 0;
6565 inp->sctp_ep.local_auth_chunks);
6567 inp->sctp_ep.local_auth_chunks);
6569 inp->asconf_supported = 1;
6571 inp->sctp_ep.local_auth_chunks);
6573 inp->sctp_ep.local_auth_chunks);
6575 SCTP_INP_WUNLOCK(inp);
6578 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6589 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6592 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6596 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6597 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6599 SCTP_INP_WLOCK(inp);
6601 inp->reconfig_supported = 0;
6603 inp->reconfig_supported = 1;
6605 SCTP_INP_WUNLOCK(inp);
6607 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6618 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6621 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6625 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6626 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6628 SCTP_INP_WLOCK(inp);
6630 inp->nrsack_supported = 0;
6632 inp->nrsack_supported = 1;
6634 SCTP_INP_WUNLOCK(inp);
6636 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6647 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6650 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6654 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6655 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6657 SCTP_INP_WLOCK(inp);
6659 inp->pktdrop_supported = 0;
6661 inp->pktdrop_supported = 1;
6663 SCTP_INP_WUNLOCK(inp);
6665 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6677 SCTP_FIND_STCB(inp, stcb, av->assoc_id);
6694 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
6695 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) ||
6697 SCTP_INP_WLOCK(inp);
6698 inp->max_cwnd = av->assoc_value;
6699 SCTP_INP_WUNLOCK(inp);
6701 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6708 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
6722 struct sctp_inpcb *inp;
6726 inp = (struct sctp_inpcb *)so->so_pcb;
6727 if (inp == NULL) {
6731 SCTP_INP_WLOCK(inp);
6732 inp->fibnum = so->so_fibnum;
6733 SCTP_INP_WUNLOCK(inp);
6789 struct sctp_inpcb *inp;
6792 inp = (struct sctp_inpcb *)so->so_pcb;
6793 if (inp == NULL) {
6795 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6799 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6809 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6814 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
6826 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6831 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
6838 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EAFNOSUPPORT);
6841 SCTP_INP_INCR_REF(inp);
6842 SCTP_ASOC_CREATE_LOCK(inp);
6846 if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) ||
6847 (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) {
6849 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EFAULT);
6854 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) &&
6856 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6861 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
6870 if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) &&
6871 (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE))) {
6872 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6876 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
6877 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
6879 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE);
6883 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
6884 SCTP_INP_RLOCK(inp);
6885 stcb = LIST_FIRST(&inp->sctp_asoc_list);
6886 SCTP_INP_RUNLOCK(inp);
6893 SCTP_INP_INCR_REF(inp);
6894 stcb = sctp_findassociation_ep_addr(&inp, addr, NULL, NULL, NULL);
6896 SCTP_INP_DECR_REF(inp);
6903 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
6907 vrf_id = inp->def_vrf_id;
6909 stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p);
6923 sctp_initialize_auth_params(inp, stcb);
6925 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
6929 SCTP_ASOC_CREATE_UNLOCK(inp);
6931 SCTP_INP_DECR_REF(inp);
6950 struct sctp_inpcb *inp;
6952 inp = (struct sctp_inpcb *)so->so_pcb;
6953 if (inp == NULL) {
6955 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
6958 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) {
6963 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
6967 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
6972 store.sin.sin_port = inp->sctp_lport;
6977 store.sin6.sin6_port = inp->sctp_lport;
6983 tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id);
6984 if (tinp && (tinp != inp) &&
6990 * its not this inp.
7002 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
7008 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
7016 store.sin.sin_port = inp->sctp_lport;
7021 store.sin6.sin6_port = inp->sctp_lport;
7027 tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id);
7028 if (tinp && (tinp != inp) &&
7034 * this inp.
7043 SCTP_INP_RLOCK(inp);
7046 sctp_log_lock(inp, (struct sctp_tcb *)NULL, SCTP_LOG_LOCK_SOCK);
7053 SCTP_INP_RUNLOCK(inp);
7056 if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) &&
7057 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
7060 * - Someone else is in the main inp slot. - We must move
7064 if (sctp_swap_inpcb_for_listen(inp)) {
7065 SCTP_INP_RUNLOCK(inp);
7066 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE);
7070 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
7071 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
7073 SCTP_INP_RUNLOCK(inp);
7074 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE);
7077 SCTP_INP_RUNLOCK(inp);
7078 if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) {
7088 if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
7106 struct sctp_inpcb *inp;
7113 inp = (struct sctp_inpcb *)so->so_pcb;
7115 if (inp == NULL) {
7116 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
7119 SCTP_INP_RLOCK(inp);
7120 if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
7121 SCTP_INP_RUNLOCK(inp);
7122 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
7126 SCTP_INP_RUNLOCK(inp);
7127 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ECONNABORTED);
7130 stcb = LIST_FIRST(&inp->sctp_asoc_list);
7132 SCTP_INP_RUNLOCK(inp);
7133 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
7137 SCTP_INP_RUNLOCK(inp);
7183 if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) {
7184 SCTP_INP_WLOCK(inp);
7185 inp->sctp_flags &= ~SCTP_PCB_FLAGS_DONT_WAKE;
7186 if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEOUTPUT) {
7187 inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT;
7188 SCTP_INP_WUNLOCK(inp);
7189 SOCKBUF_LOCK(&inp->sctp_socket->so_snd);
7190 if (sowriteable(inp->sctp_socket)) {
7191 sowwakeup_locked(inp->sctp_socket);
7193 SOCKBUF_UNLOCK(&inp->sctp_socket->so_snd);
7195 SCTP_INP_WLOCK(inp);
7197 if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEINPUT) {
7198 inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT;
7199 SCTP_INP_WUNLOCK(inp);
7200 SOCKBUF_LOCK(&inp->sctp_socket->so_rcv);
7201 if (soreadable(inp->sctp_socket)) {
7203 sorwakeup_locked(inp->sctp_socket);
7205 SOCKBUF_UNLOCK(&inp->sctp_socket->so_rcv);
7207 SCTP_INP_WLOCK(inp);
7209 SCTP_INP_WUNLOCK(inp);
7213 sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
7225 struct sctp_inpcb *inp;
7236 inp = (struct sctp_inpcb *)so->so_pcb;
7237 if (!inp) {
7239 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
7242 SCTP_INP_RLOCK(inp);
7243 sin->sin_port = inp->sctp_lport;
7244 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
7245 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
7251 stcb = LIST_FIRST(&inp->sctp_asoc_list);
7274 vrf_id = inp->def_vrf_id;
7275 sctp_ifa = sctp_source_address_selection(inp,
7295 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
7307 SCTP_INP_RUNLOCK(inp);
7308 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
7312 SCTP_INP_RUNLOCK(inp);
7323 struct sctp_inpcb *inp;
7334 inp = (struct sctp_inpcb *)so->so_pcb;
7335 if ((inp == NULL) ||
7336 ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
7339 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
7342 SCTP_INP_RLOCK(inp);
7343 stcb = LIST_FIRST(&inp->sctp_asoc_list);
7347 SCTP_INP_RUNLOCK(inp);
7350 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
7367 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);