Lines Matching refs:connp
427 conn_t *connp = tcp->tcp_connp; in tcp_set_recv_threshold() local
439 (*connp->conn_upcalls->su_set_proto_props) in tcp_set_recv_threshold()
440 (connp->conn_upper_handle, &sopp); in tcp_set_recv_threshold()
470 conn_t *connp = tcp->tcp_connp; in tcp_ipsec_cleanup() local
472 ASSERT(connp->conn_flags & IPCL_TCPCONN); in tcp_ipsec_cleanup()
474 if (connp->conn_latch != NULL) { in tcp_ipsec_cleanup()
475 IPLATCH_REFRELE(connp->conn_latch); in tcp_ipsec_cleanup()
476 connp->conn_latch = NULL; in tcp_ipsec_cleanup()
478 if (connp->conn_latch_in_policy != NULL) { in tcp_ipsec_cleanup()
479 IPPOL_REFRELE(connp->conn_latch_in_policy); in tcp_ipsec_cleanup()
480 connp->conn_latch_in_policy = NULL; in tcp_ipsec_cleanup()
482 if (connp->conn_latch_in_action != NULL) { in tcp_ipsec_cleanup()
483 IPACT_REFRELE(connp->conn_latch_in_action); in tcp_ipsec_cleanup()
484 connp->conn_latch_in_action = NULL; in tcp_ipsec_cleanup()
486 if (connp->conn_policy != NULL) { in tcp_ipsec_cleanup()
487 IPPH_REFRELE(connp->conn_policy, connp->conn_netstack); in tcp_ipsec_cleanup()
488 connp->conn_policy = NULL; in tcp_ipsec_cleanup()
501 conn_t *connp = tcp->tcp_connp; in tcp_cleanup() local
510 ixa_cleanup(connp->conn_ixa); in tcp_cleanup()
512 if (connp->conn_ht_iphc != NULL) { in tcp_cleanup()
513 kmem_free(connp->conn_ht_iphc, connp->conn_ht_iphc_allocated); in tcp_cleanup()
514 connp->conn_ht_iphc = NULL; in tcp_cleanup()
515 connp->conn_ht_iphc_allocated = 0; in tcp_cleanup()
516 connp->conn_ht_iphc_len = 0; in tcp_cleanup()
517 connp->conn_ht_ulp = NULL; in tcp_cleanup()
518 connp->conn_ht_ulp_len = 0; in tcp_cleanup()
525 ip_pkt_free(&connp->conn_xmit_ipp); in tcp_cleanup()
538 ipcl_globalhash_remove(connp); in tcp_cleanup()
545 if (connp->conn_cred != NULL) { in tcp_cleanup()
546 crfree(connp->conn_cred); in tcp_cleanup()
547 connp->conn_cred = NULL; in tcp_cleanup()
549 ipcl_conn_cleanup(connp); in tcp_cleanup()
550 connp->conn_flags = IPCL_TCPCONN; in tcp_cleanup()
557 connp->conn_netstack = NULL; in tcp_cleanup()
558 connp->conn_ixa->ixa_ipst = NULL; in tcp_cleanup()
570 tcp->tcp_connp = connp; in tcp_cleanup()
572 ASSERT(connp->conn_tcp == tcp); in tcp_cleanup()
573 ASSERT(connp->conn_flags & IPCL_TCPCONN); in tcp_cleanup()
574 connp->conn_state_flags = CONN_INCIPIENT; in tcp_cleanup()
575 ASSERT(connp->conn_proto == IPPROTO_TCP); in tcp_cleanup()
576 ASSERT(connp->conn_ref == 1); in tcp_cleanup()
613 conn_t *connp = tcp->tcp_connp; in tcp_set_destination() local
627 connp->conn_ixa->ixa_flags |= IXAF_PMTU_DISCOVERY; in tcp_set_destination()
630 mutex_enter(&connp->conn_lock); in tcp_set_destination()
631 error = conn_connect(connp, &uinfo, flags); in tcp_set_destination()
632 mutex_exit(&connp->conn_lock); in tcp_set_destination()
658 connp->conn_sndbuf = MIN(uinfo.iulp_spipe, in tcp_set_destination()
661 connp->conn_sndlowat = connp->conn_sndbuf / in tcp_set_destination()
743 if (connp->conn_ipversion == IPV4_VERSION) in tcp_set_destination()
749 tcp->tcp_ipsec_overhead = conn_ipsec_length(connp); in tcp_set_destination()
764 tcp_update_lso(tcp, connp->conn_ixa); in tcp_set_destination()
781 mutex_enter(&connp->conn_lock); in tcp_set_destination()
782 connp->conn_state_flags &= ~CONN_INCIPIENT; in tcp_set_destination()
783 mutex_exit(&connp->conn_lock); in tcp_set_destination()
820 conn_t *connp = tcp->tcp_connp; in tcp_clean_death() local
832 ASSERT((connp->conn_family == AF_INET && in tcp_clean_death()
833 connp->conn_ipversion == IPV4_VERSION) || in tcp_clean_death()
834 (connp->conn_family == AF_INET6 && in tcp_clean_death()
835 (connp->conn_ipversion == IPV4_VERSION || in tcp_clean_death()
836 connp->conn_ipversion == IPV6_VERSION))); in tcp_clean_death()
854 CONN_DEC_REF(connp); in tcp_clean_death()
858 ip_xmit_attr_t *, connp->conn_ixa, in tcp_clean_death()
887 q = connp->conn_rq; in tcp_clean_death()
890 if (!IPCL_IS_NONSTR(connp)) { in tcp_clean_death()
910 if (connp->conn_debug) { in tcp_clean_death()
914 if (IPCL_IS_NONSTR(connp)) { in tcp_clean_death()
916 (*connp->conn_upcalls->su_disconnected)( in tcp_clean_death()
917 connp->conn_upper_handle, tcp->tcp_connid, err); in tcp_clean_death()
923 if (connp->conn_debug) { in tcp_clean_death()
946 if (tcp->tcp_listener != NULL && IPCL_IS_NONSTR(connp)) { in tcp_clean_death()
950 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, NULL, in tcp_clean_death()
956 if (IPCL_IS_NONSTR(connp)) in tcp_clean_death()
957 (void) tcp_do_unbind(connp); in tcp_clean_death()
971 conn_t *connp = tcp->tcp_connp; in tcp_stop_lingering() local
994 connp->conn_rq = NULL; in tcp_stop_lingering()
995 connp->conn_wq = NULL; in tcp_stop_lingering()
1014 CONN_DEC_REF(connp); in tcp_stop_lingering()
1018 connp->conn_rq = NULL; in tcp_stop_lingering()
1019 connp->conn_wq = NULL; in tcp_stop_lingering()
1028 if (IPCL_IS_NONSTR(connp)) { in tcp_stop_lingering()
1029 ASSERT(connp->conn_upper_handle != NULL); in tcp_stop_lingering()
1030 (*connp->conn_upcalls->su_closed)(connp->conn_upper_handle); in tcp_stop_lingering()
1031 connp->conn_upper_handle = NULL; in tcp_stop_lingering()
1032 connp->conn_upcalls = NULL; in tcp_stop_lingering()
1037 tcp_close_common(conn_t *connp, int flags) in tcp_close_common() argument
1039 tcp_t *tcp = connp->conn_tcp; in tcp_close_common()
1044 ASSERT(connp->conn_ref >= 2); in tcp_close_common()
1051 mutex_enter(&connp->conn_lock); in tcp_close_common()
1052 connp->conn_state_flags |= CONN_CLOSING; in tcp_close_common()
1053 if (connp->conn_oper_pending_ill != NULL) in tcp_close_common()
1055 CONN_INC_REF_LOCKED(connp); in tcp_close_common()
1056 mutex_exit(&connp->conn_lock); in tcp_close_common()
1058 ASSERT(connp->conn_ref >= 3); in tcp_close_common()
1070 "connp %p tcp %p\n", (void *)connp, (void *)tcp); in tcp_close_common()
1079 conn_ioctl_cleanup(connp); in tcp_close_common()
1089 mutex_enter(&connp->conn_lock); in tcp_close_common()
1090 while (connp->conn_ioctlref > 0) in tcp_close_common()
1091 cv_wait(&connp->conn_cv, &connp->conn_lock); in tcp_close_common()
1092 ASSERT(connp->conn_ioctlref == 0); in tcp_close_common()
1093 ASSERT(connp->conn_oper_pending_ill == NULL); in tcp_close_common()
1094 mutex_exit(&connp->conn_lock); in tcp_close_common()
1096 SQUEUE_ENTER_ONE(connp->conn_sqp, mp, tcp_close_output, connp, in tcp_close_common()
1105 if (IPCL_IS_NONSTR(connp) && connp->conn_linger == 0) in tcp_close_common()
1126 if (connp->conn_linger && connp->conn_lingertime > 0) { in tcp_close_common()
1129 CONN_INC_REF(connp); in tcp_close_common()
1131 SQUEUE_ENTER_ONE(connp->conn_sqp, bp, in tcp_close_common()
1132 tcp_linger_interrupted, connp, NULL, in tcp_close_common()
1154 if (tcp->tcp_wait_for_eagers && !IPCL_IS_NONSTR(connp)) { in tcp_close_common()
1155 mutex_enter(&connp->conn_lock); in tcp_close_common()
1156 while (connp->conn_ref != 1) { in tcp_close_common()
1157 cv_wait(&connp->conn_cv, &connp->conn_lock); in tcp_close_common()
1159 mutex_exit(&connp->conn_lock); in tcp_close_common()
1163 connp->conn_cpid = NOPID; in tcp_close_common()
1175 conn_t *connp = (conn_t *)arg; in tcp_linger_interrupted() local
1176 tcp_t *tcp = connp->conn_tcp; in tcp_linger_interrupted()
1235 conn_t *connp = tcp->tcp_connp; in tcp_closei_local() local
1286 connp->conn_rq = NULL; in tcp_closei_local()
1287 connp->conn_wq = NULL; in tcp_closei_local()
1325 CL_INET_DISCONNECT(connp); in tcp_closei_local()
1326 ipcl_hash_remove(connp); in tcp_closei_local()
1331 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, NULL, in tcp_closei_local()
1333 ixa_cleanup(connp->conn_ixa); in tcp_closei_local()
1338 mutex_enter(&connp->conn_lock); in tcp_closei_local()
1339 connp->conn_state_flags |= CONN_CONDEMNED; in tcp_closei_local()
1340 mutex_exit(&connp->conn_lock); in tcp_closei_local()
1357 conn_t *connp = tcp->tcp_connp; in tcp_free() local
1362 connp->conn_rq = NULL; in tcp_free()
1363 connp->conn_wq = NULL; in tcp_free()
1431 if (connp->conn_upper_handle != NULL) { in tcp_free()
1432 if (IPCL_IS_NONSTR(connp)) { in tcp_free()
1433 (*connp->conn_upcalls->su_closed)( in tcp_free()
1434 connp->conn_upper_handle); in tcp_free()
1437 connp->conn_upper_handle = NULL; in tcp_free()
1438 connp->conn_upcalls = NULL; in tcp_free()
1475 conn_t *connp = NULL; in tcp_get_conn() local
1492 connp = tcp->tcp_connp; in tcp_get_conn()
1493 connp->conn_flags |= IPCL_REUSED; in tcp_get_conn()
1496 ASSERT(connp->conn_netstack == NULL); in tcp_get_conn()
1500 connp->conn_netstack = ns; in tcp_get_conn()
1501 connp->conn_ixa->ixa_ipst = ns->netstack_ip; in tcp_get_conn()
1503 ipcl_globalhash_insert(connp); in tcp_get_conn()
1505 connp->conn_ixa->ixa_notify_cookie = tcp; in tcp_get_conn()
1506 ASSERT(connp->conn_ixa->ixa_notify == tcp_notify); in tcp_get_conn()
1507 connp->conn_recv = tcp_input_data; in tcp_get_conn()
1508 ASSERT(connp->conn_recvicmp == tcp_icmp_input); in tcp_get_conn()
1509 ASSERT(connp->conn_verifyicmp == tcp_verifyicmp); in tcp_get_conn()
1510 return ((void *)connp); in tcp_get_conn()
1521 if ((connp = ipcl_conn_create(IPCL_TCPCONN, KM_NOSLEEP, in tcp_get_conn()
1527 tcp = connp->conn_tcp; in tcp_get_conn()
1533 connp->conn_recv = tcp_input_data; in tcp_get_conn()
1534 connp->conn_recvicmp = tcp_icmp_input; in tcp_get_conn()
1535 connp->conn_verifyicmp = tcp_verifyicmp; in tcp_get_conn()
1542 connp->conn_ixa->ixa_notify = tcp_notify; in tcp_get_conn()
1543 connp->conn_ixa->ixa_notify_cookie = tcp; in tcp_get_conn()
1545 return ((void *)connp); in tcp_get_conn()
1559 conn_t *connp = tcp->tcp_connp; in tcp_connect_ipv4() local
1563 ASSERT(connp->conn_ipversion == IPV4_VERSION); in tcp_connect_ipv4()
1586 if (srcid != 0 && connp->conn_laddr_v4 == INADDR_ANY) { in tcp_connect_ipv4()
1587 if (!ip_srcid_find_id(srcid, &connp->conn_laddr_v6, in tcp_connect_ipv4()
1588 IPCL_ZONEID(connp), B_TRUE, tcps->tcps_netstack)) { in tcp_connect_ipv4()
1592 connp->conn_saddr_v6 = connp->conn_laddr_v6; in tcp_connect_ipv4()
1595 IN6_IPADDR_TO_V4MAPPED(dstaddr, &connp->conn_faddr_v6); in tcp_connect_ipv4()
1596 connp->conn_fport = dstport; in tcp_connect_ipv4()
1612 lport = tcp_bindi(tcp, lport, &connp->conn_laddr_v6, 0, B_TRUE, in tcp_connect_ipv4()
1629 if (connp->conn_faddr_v4 == connp->conn_laddr_v4 && in tcp_connect_ipv4()
1630 connp->conn_fport == connp->conn_lport) in tcp_connect_ipv4()
1635 return (ipcl_conn_insert_v4(connp)); in tcp_connect_ipv4()
1647 conn_t *connp = tcp->tcp_connp; in tcp_connect_ipv6() local
1651 ASSERT(connp->conn_family == AF_INET6); in tcp_connect_ipv6()
1659 if (connp->conn_ipversion != IPV6_VERSION) in tcp_connect_ipv6()
1671 if (srcid != 0 && IN6_IS_ADDR_UNSPECIFIED(&connp->conn_laddr_v6)) { in tcp_connect_ipv6()
1672 if (!ip_srcid_find_id(srcid, &connp->conn_laddr_v6, in tcp_connect_ipv6()
1673 IPCL_ZONEID(connp), B_FALSE, tcps->tcps_netstack)) { in tcp_connect_ipv6()
1677 connp->conn_saddr_v6 = connp->conn_laddr_v6; in tcp_connect_ipv6()
1684 connp->conn_ixa->ixa_flags |= IXAF_SCOPEID_SET; in tcp_connect_ipv6()
1685 connp->conn_ixa->ixa_scopeid = scope_id; in tcp_connect_ipv6()
1687 connp->conn_ixa->ixa_flags &= ~IXAF_SCOPEID_SET; in tcp_connect_ipv6()
1690 connp->conn_flowinfo = flowinfo; in tcp_connect_ipv6()
1691 connp->conn_faddr_v6 = *dstaddrp; in tcp_connect_ipv6()
1692 connp->conn_fport = dstport; in tcp_connect_ipv6()
1708 lport = tcp_bindi(tcp, lport, &connp->conn_laddr_v6, 0, B_TRUE, in tcp_connect_ipv6()
1725 if (IN6_ARE_ADDR_EQUAL(&connp->conn_faddr_v6, &connp->conn_laddr_v6) && in tcp_connect_ipv6()
1726 connp->conn_fport == connp->conn_lport) in tcp_connect_ipv6()
1731 return (ipcl_conn_insert_v6(connp)); in tcp_connect_ipv6()
1744 conn_t *connp = tcp->tcp_connp; in tcp_disconnect_common() local
1753 if (connp->conn_debug) { in tcp_disconnect_common()
1789 if (connp->conn_ipversion == IPV4_VERSION) { in tcp_disconnect_common()
1790 lconnp = ipcl_lookup_listener_v4(connp->conn_lport, in tcp_disconnect_common()
1791 connp->conn_laddr_v4, IPCL_ZONEID(connp), ipst); in tcp_disconnect_common()
1795 if (connp->conn_ixa->ixa_flags & IXAF_SCOPEID_SET) in tcp_disconnect_common()
1796 ifindex = connp->conn_ixa->ixa_scopeid; in tcp_disconnect_common()
1799 lconnp = ipcl_lookup_listener_v6(connp->conn_lport, in tcp_disconnect_common()
1800 &connp->conn_laddr_v6, ifindex, IPCL_ZONEID(connp), in tcp_disconnect_common()
1806 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, in tcp_disconnect_common()
1812 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, in tcp_disconnect_common()
1870 conn_t *connp = tcp->tcp_connp; in tcp_disconnect() local
1884 (void) putnextctl1(connp->conn_rq, M_FLUSH, FLUSHRW); in tcp_disconnect()
1888 putnext(connp->conn_rq, mp); in tcp_disconnect()
1901 conn_t *connp = tcp->tcp_connp; in tcp_reinit() local
1906 ASSERT((connp->conn_family == AF_INET && in tcp_reinit()
1907 connp->conn_ipversion == IPV4_VERSION) || in tcp_reinit()
1908 (connp->conn_family == AF_INET6 && in tcp_reinit()
1909 (connp->conn_ipversion == IPV4_VERSION || in tcp_reinit()
1910 connp->conn_ipversion == IPV6_VERSION))); in tcp_reinit()
1931 TCP_UNSENT_BYTES(tcp) <= connp->conn_sndlowat) { in tcp_reinit()
1972 CL_INET_DISCONNECT(connp); in tcp_reinit()
1986 ipcl_hash_remove(connp); in tcp_reinit()
1988 ixa_cleanup(connp->conn_ixa); in tcp_reinit()
1991 connp->conn_laddr_v6 = connp->conn_bound_addr_v6; in tcp_reinit()
1992 connp->conn_saddr_v6 = connp->conn_bound_addr_v6; in tcp_reinit()
2023 connp->conn_recv = tcp_input_listener_unbound; in tcp_reinit()
2025 connp->conn_proto = IPPROTO_TCP; in tcp_reinit()
2026 connp->conn_faddr_v6 = ipv6_all_zeros; in tcp_reinit()
2027 connp->conn_fport = 0; in tcp_reinit()
2029 (void) ipcl_bind_insert(connp); in tcp_reinit()
2040 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, NULL, in tcp_reinit()
2044 tcp->tcp_rwnd = connp->conn_rcvbuf; in tcp_reinit()
2045 tcp->tcp_mss = connp->conn_ipversion != IPV4_VERSION ? in tcp_reinit()
2061 conn_t *connp = tcp->tcp_connp; local
2082 PRESERVE(connp->conn_rq);
2083 PRESERVE(connp->conn_wq);
2099 if (connp->conn_ht_iphc != NULL) {
2100 kmem_free(connp->conn_ht_iphc, connp->conn_ht_iphc_allocated);
2101 connp->conn_ht_iphc = NULL;
2102 connp->conn_ht_iphc_allocated = 0;
2103 connp->conn_ht_iphc_len = 0;
2104 connp->conn_ht_ulp = NULL;
2105 connp->conn_ht_ulp_len = 0;
2112 ip_pkt_free(&connp->conn_xmit_ipp);
2240 DONTCARE(connp->conn_sum); /* Init in tcp_init_values */
2242 connp->conn_faddr_v6 = ipv6_all_zeros; /* Displayed in MIB */
2244 PRESERVE(connp->conn_bound_addr_v6);
2248 connp->conn_fport = 0; /* Displayed in MIB */
2249 PRESERVE(connp->conn_lport);
2257 PRESERVE(connp->conn_family);
2259 if (connp->conn_family == AF_INET6) {
2260 connp->conn_ipversion = IPV6_VERSION;
2263 connp->conn_ipversion = IPV4_VERSION;
2267 connp->conn_bound_if = 0;
2268 connp->conn_recv_ancillary.crb_all = 0;
2337 conn_t *connp = tcp->tcp_connp; in tcp_init_values() local
2340 ASSERT((connp->conn_family == AF_INET && in tcp_init_values()
2341 connp->conn_ipversion == IPV4_VERSION) || in tcp_init_values()
2342 (connp->conn_family == AF_INET6 && in tcp_init_values()
2343 (connp->conn_ipversion == IPV4_VERSION || in tcp_init_values()
2344 connp->conn_ipversion == IPV6_VERSION))); in tcp_init_values()
2432 connp->conn_mlp_type = mlptSingle; in tcp_init_values()
2439 tcp->tcp_rwnd = connp->conn_rcvbuf; in tcp_init_values()
2449 if (!connp->conn_debug) in tcp_init_values()
2450 connp->conn_debug = tcps->tcps_dbg; in tcp_init_values()
2465 conn_t *connp = tcp->tcp_connp; in tcp_update_pmtu() local
2466 ip_xmit_attr_t *ixa = connp->conn_ixa; in tcp_update_pmtu()
2487 mss = pmtu - connp->conn_ht_iphc_len - conn_ipsec_length(connp); in tcp_update_pmtu()
2529 if ((connp->conn_ipversion == IPV4_VERSION) && in tcp_update_pmtu()
2539 conn_t *connp = tcp->tcp_connp; in tcp_maxpsz_set() local
2540 queue_t *q = connp->conn_rq; in tcp_maxpsz_set()
2557 maxpsz = MSS_ROUNDUP(connp->conn_sndbuf, mss); in tcp_maxpsz_set()
2567 if (maxpsz > connp->conn_sndbuf / 2) { in tcp_maxpsz_set()
2568 maxpsz = connp->conn_sndbuf / 2; in tcp_maxpsz_set()
2574 (void) proto_set_maxpsz(q, connp, maxpsz); in tcp_maxpsz_set()
2575 if (!(IPCL_IS_NONSTR(connp))) in tcp_maxpsz_set()
2576 connp->conn_wq->q_maxpsz = maxpsz; in tcp_maxpsz_set()
2578 (void) proto_set_tx_maxblk(q, connp, mss); in tcp_maxpsz_set()
2601 conn_t *connp; in tcp_create_common() local
2646 connp = (conn_t *)tcp_get_conn(sqp, tcps); in tcp_create_common()
2652 if (connp == NULL) { in tcp_create_common()
2656 ASSERT(connp->conn_ixa->ixa_protocol == connp->conn_proto); in tcp_create_common()
2658 connp->conn_sqp = sqp; in tcp_create_common()
2659 connp->conn_initial_sqp = connp->conn_sqp; in tcp_create_common()
2660 connp->conn_ixa->ixa_sqp = connp->conn_sqp; in tcp_create_common()
2661 tcp = connp->conn_tcp; in tcp_create_common()
2671 connp->conn_ixa->ixa_flags |= IXAF_SET_ULP_CKSUM | IXAF_VERIFY_SOURCE | in tcp_create_common()
2675 connp->conn_ixa->ixa_flags |= IXAF_NO_DEV_FLOW_CTL; in tcp_create_common()
2678 connp->conn_ixa->ixa_src_preferences = IPV6_PREFER_SRC_DEFAULT; in tcp_create_common()
2679 connp->conn_ipversion = IPV6_VERSION; in tcp_create_common()
2680 connp->conn_family = AF_INET6; in tcp_create_common()
2682 connp->conn_default_ttl = tcps->tcps_ipv6_hoplimit; in tcp_create_common()
2684 connp->conn_ipversion = IPV4_VERSION; in tcp_create_common()
2685 connp->conn_family = AF_INET; in tcp_create_common()
2687 connp->conn_default_ttl = tcps->tcps_ipv4_ttl; in tcp_create_common()
2689 connp->conn_xmit_ipp.ipp_unicast_hops = connp->conn_default_ttl; in tcp_create_common()
2692 connp->conn_cred = credp; in tcp_create_common()
2693 connp->conn_cpid = curproc->p_pid; in tcp_create_common()
2694 connp->conn_open_time = ddi_get_lbolt64(); in tcp_create_common()
2697 ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); in tcp_create_common()
2698 connp->conn_ixa->ixa_cred = credp; in tcp_create_common()
2699 connp->conn_ixa->ixa_cpid = connp->conn_cpid; in tcp_create_common()
2701 connp->conn_zoneid = zoneid; in tcp_create_common()
2703 connp->conn_ixa->ixa_zoneid = zoneid; in tcp_create_common()
2704 connp->conn_mlp_type = mlptSingle; in tcp_create_common()
2705 ASSERT(connp->conn_netstack == tcps->tcps_netstack); in tcp_create_common()
2713 connp->conn_mac_mode = CONN_MAC_AWARE; in tcp_create_common()
2715 connp->conn_zone_is_global = (crgetzoneid(credp) == GLOBAL_ZONEID); in tcp_create_common()
2721 connp->conn_rcvbuf = tcps->tcps_recv_hiwat; in tcp_create_common()
2722 connp->conn_sndbuf = tcps->tcps_xmit_hiwat; in tcp_create_common()
2724 connp->conn_sndlowat = connp->conn_sndbuf / in tcp_create_common()
2727 connp->conn_sndlowat = tcps->tcps_xmit_lowat; in tcp_create_common()
2729 connp->conn_so_type = SOCK_STREAM; in tcp_create_common()
2730 connp->conn_wroff = connp->conn_ht_iphc_allocated + in tcp_create_common()
2737 return (connp); in tcp_create_common()
2745 conn_t *connp = NULL; in tcp_open() local
2800 connp = tcp_create_common(credp, isv6, issocket, &err); in tcp_open()
2802 if (connp == NULL) { in tcp_open()
2808 connp->conn_rq = q; in tcp_open()
2809 connp->conn_wq = WR(q); in tcp_open()
2810 q->q_ptr = WR(q)->q_ptr = connp; in tcp_open()
2812 connp->conn_dev = conn_dev; in tcp_open()
2813 connp->conn_minor_arena = minor_arena; in tcp_open()
2818 tcp = connp->conn_tcp; in tcp_open()
2836 mutex_enter(&connp->conn_lock); in tcp_open()
2837 CONN_INC_REF_LOCKED(connp); in tcp_open()
2838 ASSERT(connp->conn_ref == 2); in tcp_open()
2839 connp->conn_state_flags &= ~CONN_INCIPIENT; in tcp_open()
2840 mutex_exit(&connp->conn_lock); in tcp_open()
2859 conn_t *connp = tcp->tcp_connp; in tcp_build_hdrs() local
2873 buflen = connp->conn_ht_ulp_len; in tcp_build_hdrs()
2875 bcopy(connp->conn_ht_ulp, buf, buflen); in tcp_build_hdrs()
2881 mutex_enter(&connp->conn_lock); in tcp_build_hdrs()
2882 error = conn_build_hdr_template(connp, ulplen, extralen, in tcp_build_hdrs()
2883 &connp->conn_laddr_v6, &connp->conn_faddr_v6, connp->conn_flowinfo); in tcp_build_hdrs()
2884 mutex_exit(&connp->conn_lock); in tcp_build_hdrs()
2892 tcpha = (tcpha_t *)connp->conn_ht_ulp; in tcp_build_hdrs()
2897 bcopy(buf, connp->conn_ht_ulp, buflen); in tcp_build_hdrs()
2903 tcpha->tha_lport = connp->conn_lport; in tcp_build_hdrs()
2904 tcpha->tha_fport = connp->conn_fport; in tcp_build_hdrs()
2913 cksum = sizeof (tcpha_t) + connp->conn_sum; in tcp_build_hdrs()
2918 if (connp->conn_ipversion == IPV4_VERSION) in tcp_build_hdrs()
2919 tcp->tcp_ipha = (ipha_t *)connp->conn_ht_iphc; in tcp_build_hdrs()
2921 tcp->tcp_ip6h = (ip6_t *)connp->conn_ht_iphc; in tcp_build_hdrs()
2923 if (connp->conn_ht_iphc_allocated + tcps->tcps_wroff_xtra > in tcp_build_hdrs()
2924 connp->conn_wroff) { in tcp_build_hdrs()
2925 connp->conn_wroff = connp->conn_ht_iphc_allocated + in tcp_build_hdrs()
2927 (void) proto_set_tx_wroff(connp->conn_rq, connp, in tcp_build_hdrs()
2928 connp->conn_wroff); in tcp_build_hdrs()
2960 conn_t *connp = tcp->tcp_connp; in tcp_rwnd_set() local
2977 (void) proto_set_rx_hiwat(connp->conn_rq, connp, in tcp_rwnd_set()
3003 old_max_rwnd = connp->conn_rcvbuf; in tcp_rwnd_set()
3056 connp->conn_rcvbuf = rwnd; in tcp_rwnd_set()
3072 (void) proto_set_rx_hiwat(connp->conn_rq, connp, rwnd); in tcp_rwnd_set()
3077 tcp_do_unbind(conn_t *connp) in tcp_do_unbind() argument
3079 tcp_t *tcp = connp->conn_tcp; in tcp_do_unbind()
3103 connp->conn_laddr_v6 = ipv6_all_zeros; in tcp_do_unbind()
3104 connp->conn_saddr_v6 = ipv6_all_zeros; in tcp_do_unbind()
3109 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, NULL, in tcp_do_unbind()
3112 ip_unbind(connp); in tcp_do_unbind()
3113 bzero(&connp->conn_ports, sizeof (connp->conn_ports)); in tcp_do_unbind()
3124 conn_t *connp = tcp->tcp_connp; in tcp_get_proto_props() local
3130 tcp_fuse_set_rcv_hiwat(tcp, connp->conn_rcvbuf) : in tcp_get_proto_props()
3131 connp->conn_rcvbuf; in tcp_get_proto_props()
3153 sopp->sopp_wroff = connp->conn_ht_iphc_allocated + in tcp_get_proto_props()
3156 sopp->sopp_wroff = connp->conn_ht_iphc_len + in tcp_get_proto_props()
3172 conn_t *connp = tcp->tcp_connp; in tcp_zcopy_check() local
3173 ip_xmit_attr_t *ixa = connp->conn_ixa; in tcp_zcopy_check()
3186 (void) proto_set_tx_copyopt(connp->conn_rq, connp, in tcp_zcopy_check()
3191 (void) proto_set_tx_copyopt(connp->conn_rq, connp, in tcp_zcopy_check()
3284 conn_t *connp; in tcp_zcopy_notify() local
3288 connp = tcp->tcp_connp; in tcp_zcopy_notify()
3289 if (IPCL_IS_NONSTR(connp)) { in tcp_zcopy_notify()
3290 (*connp->conn_upcalls->su_zcopy_notify) in tcp_zcopy_notify()
3291 (connp->conn_upper_handle); in tcp_zcopy_notify()
3294 stp = STREAM(connp->conn_rq); in tcp_zcopy_notify()
3367 conn_t *connp = tcp->tcp_connp; in tcp_update_zcopy() local
3373 (void) proto_set_tx_copyopt(connp->conn_rq, connp, in tcp_update_zcopy()
3380 (void) proto_set_tx_copyopt(connp->conn_rq, connp, in tcp_update_zcopy()
3397 conn_t *connp = tcp->tcp_connp; in tcp_notify() local
3401 tcp_update_lso(tcp, connp->conn_ixa); in tcp_notify()
3937 conn_t *connp = tcp->tcp_connp; in tcp_iss_init() local
3946 arg.ports = connp->conn_ports; in tcp_iss_init()
3947 arg.src = connp->conn_laddr_v6; in tcp_iss_init()
3948 arg.dst = connp->conn_faddr_v6; in tcp_iss_init()
3984 conn_t *connp = tcp->tcp_connp; in tcp_setqfull() local
3989 conn_setqfull(connp, &tcp->tcp_flow_stopped); in tcp_setqfull()
3997 conn_t *connp = tcp->tcp_connp; in tcp_clrqfull() local
4001 conn_clrqfull(connp, &tcp->tcp_flow_stopped); in tcp_clrqfull()
4050 tcp_do_bind(conn_t *connp, struct sockaddr *sa, socklen_t len, cred_t *cr, in tcp_do_bind() argument
4054 tcp_t *tcp = connp->conn_tcp; in tcp_do_bind()
4057 if (connp->conn_debug) { in tcp_do_bind()
4064 error = tcp_bind_check(connp, sa, len, cr, bind_to_req_port_only); in tcp_do_bind()
4079 tcp_do_connect(conn_t *connp, const struct sockaddr *sa, socklen_t len, in tcp_do_connect() argument
4082 tcp_t *tcp = connp->conn_tcp; in tcp_do_connect()
4093 ip_xmit_attr_t *ixa = connp->conn_ixa; in tcp_do_connect()
4109 if (connp->conn_ipv6_v6only) { in tcp_do_connect()
4128 if (connp->conn_family == AF_INET6 && in tcp_do_connect()
4129 connp->conn_ipversion == IPV6_VERSION && in tcp_do_connect()
4131 if (connp->conn_ipv6_v6only) in tcp_do_connect()
4134 connp->conn_ipversion = IPV4_VERSION; in tcp_do_connect()
4142 if (IPCL_IS_NONSTR(connp)) in tcp_do_connect()
4160 if (connp->conn_cred != cr) { in tcp_do_connect()
4162 crfree(connp->conn_cred); in tcp_do_connect()
4163 connp->conn_cred = cr; in tcp_do_connect()
4165 connp->conn_cpid = pid; in tcp_do_connect()
4176 if (connp->conn_family == AF_INET6) { in tcp_do_connect()
4188 &connp->conn_bound_addr_v6) && in tcp_do_connect()
4189 !IN6_IS_ADDR_V4MAPPED(&connp->conn_bound_addr_v6)) { in tcp_do_connect()
4208 CL_INET_CONNECT(connp, B_TRUE, error); in tcp_do_connect()
4219 mss = tcp->tcp_mss - connp->conn_ht_iphc_len; in tcp_do_connect()
4228 tcp->tcp_rwnd = connp->conn_rcvbuf; in tcp_do_connect()
4231 connp->conn_rcvbuf = tcp->tcp_rwnd; in tcp_do_connect()
4272 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, NULL, in tcp_do_connect()
4290 ip_xmit_attr_t *, connp->conn_ixa, in tcp_do_connect()
4293 &syn_mp->b_rptr[connp->conn_ixa->ixa_ip_hdr_length]); in tcp_do_connect()
4302 connp->conn_faddr_v6 = ipv6_all_zeros; in tcp_do_connect()
4303 connp->conn_fport = 0; in tcp_do_connect()
4311 tcp_do_listen(conn_t *connp, struct sockaddr *sa, socklen_t len, in tcp_do_listen() argument
4314 tcp_t *tcp = connp->conn_tcp; in tcp_do_listen()
4334 if (connp->conn_debug) { in tcp_do_listen()
4345 ASSERT(IPCL_IS_NONSTR(connp)); in tcp_do_listen()
4347 if (connp->conn_family == AF_INET) { in tcp_do_listen()
4353 ASSERT(connp->conn_family == AF_INET6); in tcp_do_listen()
4362 error = tcp_bind_check(connp, sa, len, cr, in tcp_do_listen()
4386 connp->conn_ixa, void, NULL, tcp_t *, tcp, in tcp_do_listen()
4407 connp->conn_recv = tcp_input_listener_unbound; in tcp_do_listen()
4410 error = ip_laddr_fanout_insert(connp); in tcp_do_listen()
4416 connp->conn_ixa, void, NULL, tcp_t *, tcp, void, NULL, in tcp_do_listen()
4418 connp->conn_bound_addr_v6 = ipv6_all_zeros; in tcp_do_listen()
4420 connp->conn_laddr_v6 = ipv6_all_zeros; in tcp_do_listen()
4421 connp->conn_saddr_v6 = ipv6_all_zeros; in tcp_do_listen()
4422 connp->conn_ports = 0; in tcp_do_listen()
4424 if (connp->conn_anon_port) { in tcp_do_listen()
4428 connp->conn_anon_port = B_FALSE; in tcp_do_listen()
4429 (void) tsol_mlp_anon(zone, connp->conn_mlp_type, in tcp_do_listen()
4430 connp->conn_proto, connp->conn_lport, B_FALSE); in tcp_do_listen()
4432 connp->conn_mlp_type = mlptSingle; in tcp_do_listen()
4448 ntohs(connp->conn_lport)); in tcp_do_listen()
4463 if ((tot_buf = connp->conn_rcvbuf + in tcp_do_listen()
4464 connp->conn_sndbuf) < MB) { in tcp_do_listen()