Print this page
tcp: maybe related to 721fffe3

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp/tcp_socket.c
          +++ new/usr/src/uts/common/inet/tcp/tcp_socket.c
↓ open down ↓ 46 lines elided ↑ open up ↑
  47   47  
  48   48  static void     tcp_activate(sock_lower_handle_t, sock_upper_handle_t,
  49   49                      sock_upcalls_t *, int, cred_t *);
  50   50  static int      tcp_accept(sock_lower_handle_t, sock_lower_handle_t,
  51   51                      sock_upper_handle_t, cred_t *);
  52   52  static int      tcp_bind(sock_lower_handle_t, struct sockaddr *,
  53   53                      socklen_t, cred_t *);
  54   54  static int      tcp_listen(sock_lower_handle_t, int, cred_t *);
  55   55  static int      tcp_connect(sock_lower_handle_t, const struct sockaddr *,
  56   56                      socklen_t, sock_connid_t *, cred_t *);
       57 +static int      tcp_getpeername(sock_lower_handle_t, struct sockaddr *,
       58 +                    socklen_t *, cred_t *);
       59 +static int      tcp_getsockname(sock_lower_handle_t, struct sockaddr *,
       60 +                    socklen_t *, cred_t *);
  57   61  static int      tcp_getsockopt(sock_lower_handle_t, int, int, void *,
  58   62                      socklen_t *, cred_t *);
  59   63  static int      tcp_setsockopt(sock_lower_handle_t, int, int, const void *,
  60   64                      socklen_t, cred_t *);
  61   65  static int      tcp_sendmsg(sock_lower_handle_t, mblk_t *, struct nmsghdr *,
  62      -                    cred_t *cr);
       66 +                    cred_t *);
  63   67  static int      tcp_shutdown(sock_lower_handle_t, int, cred_t *);
  64   68  static void     tcp_clr_flowctrl(sock_lower_handle_t);
  65   69  static int      tcp_ioctl(sock_lower_handle_t, int, intptr_t, int, int32_t *,
  66   70                      cred_t *);
  67   71  static int      tcp_close(sock_lower_handle_t, int, cred_t *);
  68   72  
  69   73  sock_downcalls_t sock_tcp_downcalls = {
  70   74          tcp_activate,
  71   75          tcp_accept,
  72   76          tcp_bind,
↓ open down ↓ 247 lines elided ↑ open up ↑
 320  324  
 321  325          if (connp->conn_tcp->tcp_loopback) {
 322  326                  struct sock_proto_props sopp;
 323  327  
 324  328                  sopp.sopp_flags = SOCKOPT_LOOPBACK;
 325  329                  sopp.sopp_loopback = B_TRUE;
 326  330  
 327  331                  (*connp->conn_upcalls->su_set_proto_props)(
 328  332                      connp->conn_upper_handle, &sopp);
 329  333          }
 330      -done:
 331  334          squeue_synch_exit(connp);
 332  335  
 333  336          return ((error == 0) ? EINPROGRESS : error);
 334  337  }
 335  338  
 336  339  /* ARGSUSED3 */
 337  340  int
 338  341  tcp_getpeername(sock_lower_handle_t proto_handle, struct sockaddr *addr,
 339  342      socklen_t *addrlenp, cred_t *cr)
 340  343  {
↓ open down ↓ 404 lines elided ↑ open up ↑
 745  748          return (EINPROGRESS);
 746  749  }
 747  750  
 748  751  /* ARGSUSED */
 749  752  sock_lower_handle_t
 750  753  tcp_create(int family, int type, int proto, sock_downcalls_t **sock_downcalls,
 751  754      uint_t *smodep, int *errorp, int flags, cred_t *credp)
 752  755  {
 753  756          conn_t          *connp;
 754  757          boolean_t       isv6 = family == AF_INET6;
      758 +
 755  759          if (type != SOCK_STREAM || (family != AF_INET && family != AF_INET6) ||
 756  760              (proto != 0 && proto != IPPROTO_TCP)) {
 757  761                  *errorp = EPROTONOSUPPORT;
 758  762                  return (NULL);
 759  763          }
 760  764  
 761  765          connp = tcp_create_common(credp, isv6, B_TRUE, errorp);
 762  766          if (connp == NULL) {
 763  767                  return (NULL);
 764  768          }
 765  769  
 766  770          /*
 767  771           * Put the ref for TCP. Ref for IP was already put
 768      -         * by ipcl_conn_create. Also Make the conn_t globally
 769      -         * visible to walkers
      772 +         * by ipcl_conn_create. Also make the conn_t globally
      773 +         * visible to walkers.
 770  774           */
 771  775          mutex_enter(&connp->conn_lock);
 772  776          CONN_INC_REF_LOCKED(connp);
 773  777          ASSERT(connp->conn_ref == 2);
 774  778          connp->conn_state_flags &= ~CONN_INCIPIENT;
 775  779  
 776  780          connp->conn_flags |= IPCL_NONSTR;
 777  781          mutex_exit(&connp->conn_lock);
 778  782  
 779  783          ASSERT(errorp != NULL);
↓ open down ↓ 393 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX