Print this page
%B

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 ↓ 672 lines elided ↑ open up ↑
 745  749          return (EINPROGRESS);
 746  750  }
 747  751  
 748  752  /* ARGSUSED */
 749  753  sock_lower_handle_t
 750  754  tcp_create(int family, int type, int proto, sock_downcalls_t **sock_downcalls,
 751  755      uint_t *smodep, int *errorp, int flags, cred_t *credp)
 752  756  {
 753  757          conn_t          *connp;
 754  758          boolean_t       isv6 = family == AF_INET6;
      759 +
 755  760          if (type != SOCK_STREAM || (family != AF_INET && family != AF_INET6) ||
 756  761              (proto != 0 && proto != IPPROTO_TCP)) {
 757  762                  *errorp = EPROTONOSUPPORT;
 758  763                  return (NULL);
 759  764          }
 760  765  
 761  766          connp = tcp_create_common(credp, isv6, B_TRUE, errorp);
 762  767          if (connp == NULL) {
 763  768                  return (NULL);
 764  769          }
 765  770  
 766  771          /*
 767  772           * 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
      773 +         * by ipcl_conn_create. Also make the conn_t globally
      774 +         * visible to walkers.
 770  775           */
 771  776          mutex_enter(&connp->conn_lock);
 772  777          CONN_INC_REF_LOCKED(connp);
 773  778          ASSERT(connp->conn_ref == 2);
 774  779          connp->conn_state_flags &= ~CONN_INCIPIENT;
 775  780  
 776  781          connp->conn_flags |= IPCL_NONSTR;
 777  782          mutex_exit(&connp->conn_lock);
 778  783  
 779  784          ASSERT(errorp != NULL);
↓ open down ↓ 393 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX