Lines Matching refs:inp

195 sctp6_notify_mbuf(struct sctp_inpcb *inp, struct icmp6_hdr *icmp6,
200 if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
220 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, NULL,
264 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, NULL);
273 sctp6_notify(struct sctp_inpcb *inp,
286 if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
336 so = SCTP_INP_SO(inp);
343 (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
389 struct sctp_inpcb *inp = NULL;
403 inp = NULL;
414 &inp, &net, 1, vrf_id);
415 /* inp's ref-count increased && stcb locked */
416 if (stcb != NULL && inp && (inp->sctp_socket != NULL)) {
418 sctp6_notify_mbuf(inp,
423 /* inp's ref-count reduced && stcb unlocked */
425 sctp6_notify(inp, ip6cp->ip6c_icmp6, &sh,
428 /* inp's ref-count reduced && stcb unlocked */
431 if (PRC_IS_REDIRECT(cmd) && inp) {
432 in6_rtchange((struct in6pcb *)inp,
435 if (inp) {
436 /* reduce inp's ref-count */
437 SCTP_INP_WLOCK(inp);
438 SCTP_INP_DECR_REF(inp);
439 SCTP_INP_WUNLOCK(inp);
456 struct sctp_inpcb *inp;
482 &inp, &net, 1, vrf_id);
483 if (stcb == NULL || inp == NULL || inp->sctp_socket == NULL) {
484 if ((inp != NULL) && (stcb == NULL)) {
486 SCTP_INP_WLOCK(inp);
487 SCTP_INP_DECR_REF(inp);
490 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
501 SCTP_INP_WLOCK(inp);
503 error = cr_canseesocket(req->td->td_ucred, inp->sctp_socket);
505 SCTP_INP_WUNLOCK(inp);
508 cru2x(inp->sctp_socket->so_cred, &xuc);
509 SCTP_INP_WUNLOCK(inp);
524 struct sctp_inpcb *inp;
527 inp = (struct sctp_inpcb *)so->so_pcb;
528 if (inp == NULL) {
529 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
533 flags = inp->sctp_flags;
535 sctp_log_closing(inp, NULL, 17);
538 (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) {
540 sctp_log_closing(inp, NULL, 16);
542 sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
555 flags = inp->sctp_flags;
568 struct sctp_inpcb *inp;
571 inp = (struct sctp_inpcb *)so->so_pcb;
572 if (inp != NULL) {
573 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
584 inp = (struct sctp_inpcb *)so->so_pcb;
585 SCTP_INP_WLOCK(inp);
586 inp->sctp_flags |= SCTP_PCB_FLAGS_BOUND_V6; /* I'm v6! */
587 inp6 = (struct in6pcb *)inp;
604 SCTP_INP_WUNLOCK(inp);
611 struct sctp_inpcb *inp;
615 inp = (struct sctp_inpcb *)so->so_pcb;
616 if (inp == NULL) {
617 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
625 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
633 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
639 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
643 inp6 = (struct in6pcb *)inp;
689 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
698 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
732 struct sctp_inpcb *inp;
741 inp = (struct sctp_inpcb *)so->so_pcb;
742 if (inp == NULL) {
748 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
751 inp6 = (struct in6pcb *)inp;
756 if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) &&
766 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EDESTADDRREQ);
777 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
781 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
796 if (inp->control) {
798 SCTP_RELEASE_PKT(inp->control);
799 inp->control = NULL;
801 inp->control = control;
804 if (inp->pkt) {
805 SCTP_BUF_NEXT(inp->pkt_last) = m;
806 inp->pkt_last = m;
808 inp->pkt_last = inp->pkt = m;
823 ret = sctp_output(inp, inp->pkt, addr, inp->control, p, flags);
824 inp->pkt = NULL;
825 inp->control = NULL;
837 struct sctp_inpcb *inp;
850 inp = (struct sctp_inpcb *)so->so_pcb;
851 if (inp == NULL) {
852 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
857 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
864 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
872 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
878 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
882 vrf_id = inp->def_vrf_id;
883 SCTP_ASOC_CREATE_LOCK(inp);
884 SCTP_INP_RLOCK(inp);
885 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
888 SCTP_INP_RUNLOCK(inp);
891 SCTP_ASOC_CREATE_UNLOCK(inp);
895 SCTP_INP_RLOCK(inp);
897 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
898 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
900 SCTP_INP_RUNLOCK(inp);
901 SCTP_ASOC_CREATE_UNLOCK(inp);
902 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EADDRINUSE);
913 SCTP_INP_RUNLOCK(inp);
914 SCTP_ASOC_CREATE_UNLOCK(inp);
915 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
919 SCTP_INP_RUNLOCK(inp);
920 SCTP_ASOC_CREATE_UNLOCK(inp);
921 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
932 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
933 stcb = LIST_FIRST(&inp->sctp_asoc_list);
937 SCTP_INP_RUNLOCK(inp);
939 SCTP_INP_RUNLOCK(inp);
940 SCTP_INP_WLOCK(inp);
941 SCTP_INP_INCR_REF(inp);
942 SCTP_INP_WUNLOCK(inp);
943 stcb = sctp_findassociation_ep_addr(&inp, addr, NULL, NULL, NULL);
945 SCTP_INP_WLOCK(inp);
946 SCTP_INP_DECR_REF(inp);
947 SCTP_INP_WUNLOCK(inp);
953 SCTP_ASOC_CREATE_UNLOCK(inp);
955 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EALREADY);
959 stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p);
960 SCTP_ASOC_CREATE_UNLOCK(inp);
974 sctp_initialize_auth_params(inp, stcb);
976 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
985 struct sctp_inpcb *inp;
1000 inp = (struct sctp_inpcb *)so->so_pcb;
1001 if (inp == NULL) {
1003 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
1006 SCTP_INP_RLOCK(inp);
1007 sin6->sin6_port = inp->sctp_lport;
1008 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
1010 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1016 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1037 vrf_id = inp->def_vrf_id;
1038 sctp_ifa = sctp_source_address_selection(inp, stcb, (sctp_route_t *) & net->ro, net, 0, vrf_id);
1052 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
1064 SCTP_INP_RUNLOCK(inp);
1065 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
1069 SCTP_INP_RUNLOCK(inp);
1085 struct sctp_inpcb *inp;
1097 inp = (struct sctp_inpcb *)so->so_pcb;
1098 if ((inp == NULL) ||
1099 ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
1102 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOTCONN);
1105 SCTP_INP_RLOCK(inp);
1106 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1110 SCTP_INP_RUNLOCK(inp);
1113 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
1130 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
1135 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, error);