Lines Matching refs:inp

222  *    inp is locked, and is unlocked before returning.
228 struct inpcb *inp = tp->t_inpcb;
233 int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6;
237 INP_WLOCK_ASSERT(inp);
239 /* A dropped inp should never transition to TIME_WAIT state. */
240 KASSERT((inp->inp_flags & INP_DROPPED) == 0, ("tcp_twstart: "
241 "(inp->inp_flags & INP_DROPPED) != 0"));
247 error = in6_localaddr(&inp->in6p_faddr);
253 error = in_localip(inp->inp_faddr);
258 INP_WUNLOCK(inp);
284 INP_WUNLOCK(inp);
292 tw->tw_inpcb = inp;
293 in_pcbref(inp); /* Reference from tw */
298 so = inp->inp_socket;
351 inp->inp_ppcb = tw;
352 inp->inp_flags |= INP_TIMEWAIT;
360 if (inp->inp_flags & INP_SOCKREF) {
363 inp->inp_flags &= ~INP_SOCKREF;
364 INP_WUNLOCK(inp);
370 INP_WUNLOCK(inp);
379 tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th,
387 INP_WLOCK_ASSERT(inp);
395 tw = intotw(inp);
481 INP_WUNLOCK(inp);
490 struct inpcb *inp;
501 inp = tw->tw_inpcb;
502 KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait"));
503 KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw"));
505 INP_WLOCK_ASSERT(inp);
508 inp->inp_ppcb = NULL;
509 in_pcbdrop(inp);
511 so = inp->inp_socket;
519 if (inp->inp_flags & INP_SOCKREF) {
520 inp->inp_flags &= ~INP_SOCKREF;
521 INP_WUNLOCK(inp);
534 INP_WUNLOCK(inp);
541 in_pcbfree(inp);
549 struct inpcb *inp = tw->tw_inpcb;
562 int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6;
566 INP_WLOCK_ASSERT(inp);
574 mac_inpcb_create_mbuf(inp, m);
582 tcpip_fillheaders(inp, ip6, th);
593 tcpip_fillheaders(inp, ip, th);
626 ip6->ip6_hlim = in6_selecthlim(inp, NULL);
628 error = ip6_output(m, inp->in6p_outputopts, NULL,
629 (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp);
644 error = ip_output(m, inp->inp_options, NULL,
646 NULL, inp);
676 struct inpcb *inp;
682 inp = tw->tw_inpcb;
693 released = in_pcbrele_wlocked(inp);
694 KASSERT(!released, ("%s: inp should not be released here", __func__));
705 struct inpcb *inp;
735 inp = tw->tw_inpcb;
736 in_pcbref(inp);
741 INP_WLOCK(inp);
742 tw = intotw(inp);
743 if (in_pcbrele_wlocked(inp)) {
749 * state the inp should not be destroyed
756 "|| inp last reference) && tw != "
761 "|| inp last reference) && tw != "
771 INP_WUNLOCK(inp);
782 INP_WLOCK(inp);
783 if (!in_pcbrele_wlocked(inp))
784 INP_WUNLOCK(inp);