Home | History | Annotate | Download | only in netinet

Lines Matching refs:inp

127 SCTP_INP_RLOCK(struct sctp_inpcb *inp)
130 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
134 if (mtx_owned(&(inp)->inp_mtx))
135 panic("INP Recursive Lock-R");
136 mtx_lock(&(inp)->inp_mtx);
140 SCTP_INP_WLOCK(struct sctp_inpcb *inp)
142 SCTP_INP_RLOCK(inp);
148 struct sctp_inpcb *inp;
150 LIST_FOREACH(inp, &sctppcbinfo.listhead, sctp_list) {
151 if (mtx_owned(&(inp)->inp_mtx))
152 panic("info-lock and own inp lock?");
153 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
159 panic("INP INFO Recursive Lock-R");
172 struct sctp_inpcb *inp;
176 panic("INP INFO lock is owned?");
178 LIST_FOREACH(inp, &sctppcbinfo.listhead, sctp_list) {
179 if (mtx_owned(&(inp)->inp_mtx))
180 panic("You own an INP lock?");
181 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
212 * lookups that have a definte ep, the INP structure is
214 * find the INP (usually when a **inp is passed) then
216 * lock the INP too. Note that if we lock it we must
244 struct sctp_inpcb *inp;
273 LIST_FOREACH(inp, ephead, sctp_hash) {
274 if (lport != inp->sctp_lport) {
277 SCTP_INP_RLOCK(inp);
279 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
283 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
311 SCTP_INP_RUNLOCK(inp);
325 SCTP_INP_RUNLOCK(inp);
333 SCTP_INP_RUNLOCK(inp);
342 stcb = LIST_FIRST(&inp->sctp_asoc_list);
344 SCTP_INP_RUNLOCK(inp);
351 SCTP_INP_RUNLOCK(inp);
362 *inp_p = inp;
363 SCTP_INP_RUNLOCK(inp);
369 SCTP_INP_RUNLOCK(inp);
485 struct sctp_inpcb *inp;
490 inp = *inp_p;
505 if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) {
511 * real inp.
513 if (inp->sctp_flags & SCTP_PCB_FLAGS_ACCEPTING) {
519 SCTP_INP_WLOCK(inp);
520 SCTP_INP_DECR_REF(inp);
521 SCTP_INP_WUNLOCK(inp);
534 SCTP_INP_WLOCK(inp);
535 stcb = LIST_FIRST(&inp->sctp_asoc_list);
553 SCTP_INP_DECR_REF(inp);
555 SCTP_INP_WUNLOCK(inp);
563 SCTP_INP_WLOCK(inp);
564 head = &inp->sctp_tcbhash[SCTP_PCBHASH_ALLADDR(rport,
565 inp->sctp_hashmark)];
583 SCTP_INP_DECR_REF(inp);
585 SCTP_INP_WUNLOCK(inp);
596 if (locked_tcb->sctp_ep != inp) {
604 SCTP_INP_WUNLOCK(inp);
615 sctp_findassociation_ep_asocid(struct sctp_inpcb *inp, vaddr_t asoc_id)
624 if (asoc_id == 0 || inp == NULL) {
642 if (inp != stcb->sctp_ep) {
664 struct sctp_inpcb *inp;
685 LIST_FOREACH(inp, head, sctp_hash) {
686 SCTP_INP_RLOCK(inp);
688 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) &&
689 (inp->sctp_lport == lport)) {
692 (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
693 (((struct in6pcb *)inp)->in6p_flags & IN6P_IPV6_V6ONLY)
696 SCTP_INP_RUNLOCK(inp);
701 (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
702 SCTP_INP_RUNLOCK(inp);
705 SCTP_INP_RUNLOCK(inp);
706 return (inp);
708 SCTP_INP_RUNLOCK(inp);
729 LIST_FOREACH(inp, head, sctp_hash) {
730 SCTP_INP_RLOCK(inp);
731 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL)) {
732 SCTP_INP_RUNLOCK(inp);
739 if (inp->sctp_lport != lport) {
740 SCTP_INP_RUNLOCK(inp);
748 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
790 printf("YES, return ep:%p\n", inp);
793 SCTP_INP_RUNLOCK(inp);
794 return (inp);
804 printf("YES, return ep:%p\n", inp);
807 SCTP_INP_RUNLOCK(inp);
808 return (inp);
812 SCTP_INP_RUNLOCK(inp);
831 struct sctp_inpcb *inp;
865 inp = sctp_endpoint_probe(nam, head, lport);
874 if (inp == NULL && find_tcp_pool) {
890 inp = sctp_endpoint_probe(nam, head, lport);
891 if (inp) {
900 printf("EP to return is %p\n", inp);
904 if (inp) {
905 SCTP_INP_WLOCK(inp);
906 SCTP_INP_INCR_REF(inp);
907 SCTP_INP_WUNLOCK(inp);
911 if (inp) {
912 SCTP_INP_WLOCK(inp);
913 SCTP_INP_INCR_REF(inp);
914 SCTP_INP_WUNLOCK(inp);
917 return (inp);
929 struct sctp_inpcb *inp;
937 retval = sctp_tcb_special_locate(&inp, from, to, netp);
944 inp = sctp_pcb_findep(to, 0, 1);
946 *inp_p = inp;
950 if (inp == NULL) {
963 return (sctp_findassociation_ep_addr(&inp, from, netp, to, NULL));
1133 struct sctp_inpcb *inp;
1210 inp = *inp_p;
1212 retval = sctp_findassociation_addr_sa(to, from, &inp, netp,
1217 printf("retval:%p inp:%p\n", retval, inp);
1220 if (retval == NULL && inp) {
1225 inp, inp->sctp_flags);
1238 if (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) {
1301 struct sctp_inpcb *inp;
1315 * This code audits the entire INP list to see if
1329 inp = LIST_FIRST(&sctppcbinfo.listhead);
1330 while (inp) {
1331 n_inp = LIST_NEXT(inp, sctp_list);
1332 if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) {
1333 if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) {
1337 sctp_inpcb_free(inp, 1);
1341 inp = n_inp;
1347 inp = (struct sctp_inpcb *)SCTP_ZONE_GET(sctppcbinfo.ipi_zone_ep);
1348 if (inp == NULL) {
1355 memset(inp, 0, sizeof(*inp));
1358 inp->sctp_socket = so;
1361 inp->ip_inp.inp.inp_socket = so;
1362 inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT;
1367 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_ep, inp);
1372 inp->ip_inp.inp.inp_sp = pcb_sp;
1373 pcb_sp->sp_inph = (struct inpcb_hdr *)inp;
1377 inp->inp_ip_ttl = ip_defttl;
1378 inp->inp_ip_tos = 0;
1380 so->so_pcb = (void *)inp;
1385 inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE |
1387 inp->sctp_flags |= (SCTP_PCB_FLAGS_RECVDATAIOEVNT);
1392 inp->sctp_flags = (SCTP_PCB_FLAGS_TCPTYPE |
1394 inp->sctp_flags |= (SCTP_PCB_FLAGS_RECVDATAIOEVNT);
1402 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_ep, inp);
1406 inp->sctp_tcbhash = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_hash);
1407 if (inp->sctp_tcbhash == NULL) {
1409 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_ep, inp);
1414 LIST_INIT(&inp->sctp_tcbhash[i]);
1417 inp->sctp_hashmark = i - 1;
1420 SCTP_INP_LOCK_INIT(inp);
1421 SCTP_ASOC_CREATE_LOCK_INIT(inp);
1423 SCTP_INP_WLOCK(inp);
1426 LIST_INSERT_HEAD(&sctppcbinfo.listhead, inp, sctp_list);
1429 LIST_INIT(&inp->sctp_addr_list);
1430 LIST_INIT(&inp->sctp_asoc_list);
1431 TAILQ_INIT(&inp->sctp_queue_list);
1433 callout_init(&inp->sctp_ep.signature_change.timer, 0);
1434 inp->sctp_ep.signature_change.type = SCTP_TIMER_TYPE_NEWCOOKIE;
1437 m = &inp->sctp_ep;
1479 sctp_timer_start(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL);
1483 SCTP_INP_WUNLOCK(inp);
1572 sctp_isport_inuse(struct sctp_inpcb *inp, uint16_t lport)
1587 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
1591 /* inp is BOUND_V4 no conflict */
1599 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
1600 (((struct in6pcb *)inp)->in6p_flags & IN6P_IPV6_V6ONLY)
1617 struct sctp_inpcb *inp, *inp_tmp;
1625 inp = (struct sctp_inpcb *)so->so_pcb;
1636 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) == 0) {
1646 if (((struct in6pcb *)inp)->in6p_flags & IN6P_IPV6_V6ONLY) {
1660 inp->ip_inp.inp.inp_af = AF_INET;
1684 inp->ip_inp.inp.inp_af = AF_INET6;
1691 inp->ip_inp.inp.inp_socket = so;
1692 error = ipsec_init_pcbpolicy(so, &inp->ip_inp.inp.inp_sp);
1695 inp->ip_inp.inp.inp_sp->sp_inph = (struct inpcb_hdr *)inp;
1705 SCTP_INP_WLOCK(inp);
1707 SCTP_INP_INCR_REF(inp);
1722 SCTP_INP_DECR_REF(inp);
1723 SCTP_INP_WUNLOCK(inp);
1727 SCTP_INP_WUNLOCK(inp);
1732 * should NEVER be inp. And it is this
1733 * inp (inp_tmp) that gets the reference
1744 SCTP_INP_WLOCK(inp);
1747 inp, lport)) {
1749 SCTP_INP_DECR_REF(inp);
1750 SCTP_INP_WUNLOCK(inp);
1762 * setup the inp to the top (I could use the union but this
1770 port_guess = sctp_select_initial_TSN(&inp->sctp_ep);
1779 if (sctp_isport_inuse(inp, htons(port_attempt)) == 0) {
1793 if (sctp_isport_inuse(inp, htons(port_attempt)) == 0) {
1808 if (sctp_isport_inuse(inp, htons(port_attempt)) == 0) {
1817 SCTP_INP_DECR_REF(inp);
1818 if (inp->sctp_flags & (SCTP_PCB_FLAGS_SOCKET_GONE|SCTP_PCB_FLAGS_SOCKET_ALLGONE)) {
1823 SCTP_INP_WUNLOCK(inp);
1830 inp->sctp_flags |= (SCTP_PCB_FLAGS_BOUNDALL |
1834 inp->sctp_flags &= ~SCTP_PCB_FLAGS_AUTO_ASCONF;
1836 inp->sctp_flags |= SCTP_PCB_FLAGS_AUTO_ASCONF;
1873 SCTP_INP_WUNLOCK(inp);
1888 SCTP_INP_WUNLOCK(inp);
1894 inp->sctp_flags &= ~SCTP_PCB_FLAGS_BOUNDALL;
1897 inp->sctp_flags &= ~SCTP_PCB_FLAGS_AUTO_ASCONF;
1901 inp->sctp_flags &= ~SCTP_PCB_FLAGS_AUTO_ASCONF;
1903 inp->sctp_flags |= SCTP_PCB_FLAGS_AUTO_ASCONF;
1906 inp->sctp_flags |= SCTP_PCB_FLAGS_DO_ASCONF;
1908 error = sctp_insert_laddr(&inp->sctp_addr_list, ifa);
1910 SCTP_INP_WUNLOCK(inp);
1914 inp->laddr_count++;
1920 LIST_INSERT_HEAD(head, inp, sctp_hash);
1927 inp->sctp_lport = lport;
1930 inp->sctp_flags &= ~SCTP_PCB_FLAGS_UNBOUND;
1931 SCTP_INP_WUNLOCK(inp);
1938 sctp_iterator_inp_being_freed(struct sctp_inpcb *inp, struct sctp_inpcb *inp_next)
1954 if (it == inp->inp_starting_point_for_iterator)
1957 if (it->inp == inp) {
1960 * inp->inp_starting_point_for_iterator has the lock
1962 * its is not running but waiting for inp->inp_starting_point_for_iterator
1963 * to be released by the guy that does have our INP in a lock.
1966 it->inp = NULL;
1970 it->inp = inp_next;
1975 it = inp->inp_starting_point_for_iterator;
1978 it->inp = NULL;
1980 it->inp = inp_next;
1988 sctp_inpcb_free(struct sctp_inpcb *inp, int immediate)
2011 SCTP_ASOC_CREATE_LOCK(inp);
2012 SCTP_INP_WLOCK(inp);
2014 if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) {
2018 SCTP_INP_WUNLOCK(inp);
2019 SCTP_ASOC_CREATE_UNLOCK(inp);
2022 sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL);
2024 sctp_m_freem(inp->control);
2025 inp->control = NULL;
2026 sctp_m_freem(inp->pkt);
2027 inp->pkt = NULL;
2028 so = inp->sctp_socket;
2029 ip_pcb = &inp->ip_inp.inp; /* we could just cast the main
2037 for ((asoc = LIST_FIRST(&inp->sctp_asoc_list)); asoc != NULL;
2044 SCTP_INP_WUNLOCK(inp);
2045 sctp_free_assoc(inp, asoc);
2046 SCTP_INP_WLOCK(inp);
2073 SCTP_INP_WUNLOCK(inp);
2074 sctp_free_assoc(inp, asoc);
2075 SCTP_INP_WLOCK(inp);
2089 sctp_chunk_output(inp, asoc, 1);
2100 inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_GONE;
2102 SCTP_INP_WUNLOCK(inp);
2103 SCTP_ASOC_CREATE_UNLOCK(inp);
2108 if (inp->refcount) {
2109 sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL);
2110 SCTP_INP_WUNLOCK(inp);
2111 SCTP_ASOC_CREATE_UNLOCK(inp);
2115 inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_ALLGONE;
2121 callout_stop(&inp->sctp_ep.signature_change.timer);
2122 callout_destroy(&inp->sctp_ep.signature_change.timer);
2142 inp->inp_vflag = 0;
2151 for ((asoc = LIST_FIRST(&inp->sctp_asoc_list)); asoc != NULL;
2176 inp->sctp_flags &= ~SCTP_PCB_FLAGS_SOCKET_GONE;
2177 SCTP_INP_WUNLOCK(inp);
2178 sctp_free_assoc(inp, asoc);
2179 SCTP_INP_WLOCK(inp);
2181 while ((sq = TAILQ_FIRST(&inp->sctp_queue_list)) != NULL) {
2182 TAILQ_REMOVE(&inp->sctp_queue_list, sq, next_sq);
2187 inp->sctp_socket = 0;
2190 /* Unlock inp first, need correct order */
2191 SCTP_INP_WUNLOCK(inp);
2196 /* now reget the inp lock */
2197 SCTP_INP_WLOCK(inp);
2199 inp_save = LIST_NEXT(inp, sctp_list);
2200 LIST_REMOVE(inp, sctp_list);
2205 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) !=
2211 LIST_REMOVE(inp, sctp_hash);
2214 sctp_iterator_inp_being_freed(inp, inp_save);
2221 for ((laddr = LIST_FIRST(&inp->sctp_addr_list)); laddr != NULL;
2231 if (inp->sctp_tcbhash != NULL) {
2232 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_hash, inp->sctp_tcbhash);
2233 inp->sctp_tcbhash = NULL;
2235 SCTP_INP_WUNLOCK(inp);
2236 SCTP_ASOC_CREATE_UNLOCK(inp);
2237 SCTP_INP_LOCK_DESTROY(inp);
2238 SCTP_ASOC_CREATE_LOCK_DESTROY(inp);
2241 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_ep, inp);
2612 sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
2631 SCTP_INP_RLOCK(inp);
2632 if (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) {
2639 SCTP_INP_RUNLOCK(inp);
2665 SCTP_INP_RUNLOCK(inp);
2681 SCTP_INP_RUNLOCK(inp);
2693 SCTP_INP_RUNLOCK(inp);
2697 SCTP_INP_RUNLOCK(inp);
2698 if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) {
2709 if ((err = sctp_inpcb_bind(inp->sctp_socket,
2743 stcb->sctp_ep = inp;
2744 stcb->sctp_socket = inp->sctp_socket;
2745 if ((err = sctp_init_asoc(inp, asoc, for_a_init, override_tag))) {
2761 SCTP_INP_WLOCK(inp);
2762 if (inp->sctp_flags & (SCTP_PCB_FLAGS_SOCKET_GONE|SCTP_PCB_FLAGS_SOCKET_ALLGONE)) {
2766 SCTP_INP_WUNLOCK(inp);
2812 LIST_INSERT_HEAD(&inp->sctp_asoc_list, stcb, sctp_tcblist);
2816 inp->sctp_hashmark, sctp_pcbtblsize);
2818 if (inp->sctp_tcbhash != NULL) {
2819 head = &inp->sctp_tcbhash[SCTP_PCBHASH_ALLADDR(stcb->rport,
2820 inp->sctp_hashmark)];
2826 SCTP_INP_WUNLOCK(inp);
2919 sctp_add_vtag_to_timewait(struct sctp_inpcb *inp, u_int32_t tag)
2977 sctp_iterator_asoc_being_freed(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
2991 SCTP_INP_WLOCK(inp);
2998 if (it->inp != stcb->sctp_ep) {
3009 it->inp = NULL;
3012 it->inp = LIST_NEXT(inp, sctp_list);
3021 sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
3063 * and INP write locked and the TCB locked
3068 sctp_iterator_asoc_being_freed(inp, stcb);
3071 TAILQ_FOREACH(sq, &inp->sctp_queue_list, next_sq) {
3077 if (inp->sctp_tcb_at_block == (void *)stcb) {
3078 inp->error_on_block = ECONNRESET;
3081 if (inp->sctp_tcbhash) {
3086 SCTP_INP_WUNLOCK(inp);
3099 sctp_add_vtag_to_timewait(inp, asoc->my_vtag);
3303 if ((inp->sctp_socket->so_snd.sb_cc) ||
3304 (inp->sctp_socket->so_snd.sb_mbcnt)) {
3306 inp->sctp_socket->so_snd.sb_cc = 0;
3307 inp->sctp_socket->so_snd.sb_mbcnt = 0;
3309 if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) {
3310 if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0) {
3311 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
3318 inp->sctp_flags &= ~SCTP_PCB_FLAGS_CONNECTED;
3319 soisdisconnected(inp->sctp_socket);
3328 if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) {
3329 sctp_inpcb_free(inp, 0);
3347 struct sctp_inpcb *inp;
3352 * INP lock by the caller applied (in asconf case when
3354 * if HB then the INP increment is up and the INP
3361 inp = stcb->sctp_ep;
3362 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3373 answer = inp->inp_vflag & INP_IPV6;
3375 answer = inp->inp_vflag & INP_IPV4;
3387 sctp_update_ep_vflag(struct sctp_inpcb *inp) {
3391 inp->inp_vflag = 0;
3394 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
3407 inp->inp_vflag |= INP_IPV6;
3409 inp->inp_vflag |= INP_IPV4;
3419 sctp_add_local_addr_ep(struct sctp_inpcb *inp, struct ifaddr *ifa)
3425 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3438 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
3445 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) && (fnd == 0)) {
3447 error = sctp_insert_laddr(&inp->sctp_addr_list, ifa);
3450 inp->laddr_count++;
3453 inp->inp_vflag |= INP_IPV6;
3455 inp->inp_vflag |= INP_IPV4;
3491 sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct ifaddr *ifa)
3496 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3501 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
3507 if (fnd && (inp->laddr_count < 2)) {
3511 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) && (fnd)) {
3521 if (inp->next_addr_touse == laddr)
3523 inp->next_addr_touse = NULL;
3526 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
3534 inp->laddr_count--;
3536 sctp_update_ep_vflag(inp);
3538 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
3539 /* presume caller (sctp_asconf.c) already owns INP lock */
3564 * the INP. May need to confirm/fix that if
3641 struct sctp_inpcb *inp;
3647 * b) The INP is locked.
3651 * that it does lock the INP during its work often
3657 inp = stcb->sctp_ep;
3659 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) &&
3660 ((inp->sctp_flags & SCTP_PCB_FLAGS_DO_ASCONF) == 0)) {
3688 struct sctp_inpcb *inp;
3696 * at the least and probably the INP as well.
3698 inp = stcb->sctp_ep;
3700 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) &&
3701 ((inp->sctp_flags & SCTP_PCB_FLAGS_DO_ASCONF) == 0)) {
3906 struct sctp_inpcb *inp, *l_inp;
3973 l_inp = inp = stcb->sctp_ep;
3974 stcb_tmp = sctp_findassociation_ep_addr(&inp, sa, &net_tmp, local_sa, stcb);
3975 if ((stcb_tmp == NULL && inp == stcb->sctp_ep) || inp == NULL) {
4034 inp = stcb->sctp_ep;
4035 stcb_tmp = sctp_findassociation_ep_addr(&inp, sa, &net,
4038 inp == stcb->sctp_ep) ||
4039 inp == NULL) {
4074 SCTP_INP_RLOCK(inp);
4103 inp = stcb->sctp_ep;
4104 stcb_tmp= sctp_findassociation_ep_addr(&inp, sa, &net,
4106 if (stcb_tmp == NULL && (inp == stcb->sctp_ep ||
4107 inp == NULL)) {
4337 sctp_is_vtag_good(struct sctp_inpcb *inp, u_int32_t tag, struct timeval *now)
4369 if (inp == stcb->sctp_ep) {
4411 sctp_del_local_addr_ep_sa(struct sctp_inpcb *inp, struct sockaddr *sa)
4419 * user MUST have the INP locked.
4423 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
4428 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
4463 if (found && inp->laddr_count < 2) {
4468 if (found && (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
4486 sctp_drain_mbufs(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
4611 struct sctp_inpcb *inp;
4615 LIST_FOREACH(inp, &sctppcbinfo.listhead, sctp_list) {
4617 SCTP_INP_RLOCK(inp);
4618 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
4621 sctp_drain_mbufs(inp, stcb);
4624 SCTP_INP_RUNLOCK(inp);
4630 sctp_add_to_socket_q(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
4634 /* write lock on INP assumed */
4635 if ((inp == NULL) || (stcb == NULL)) {
4650 TAILQ_INSERT_TAIL(&inp->sctp_queue_list, sq, next_sq);
4656 sctp_remove_from_socket_q(struct sctp_inpcb *inp)
4661 /* W-Lock on INP assumed held */
4662 sq = TAILQ_FIRST(&inp->sctp_queue_list);
4667 TAILQ_REMOVE(&inp->sctp_queue_list, sq, next_sq);
4699 it->inp = s_inp;
4703 it->inp = LIST_FIRST(&sctppcbinfo.listhead);