Print this page
12694 race between write() and shutdown() for unix sockets

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/tihdr.h
          +++ new/usr/src/uts/common/sys/tihdr.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  22   22  /*      All Rights Reserved     */
  23   23  
  24   24  
  25   25  /*
  26   26   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
       27 + * Copyright 2020 Joyent, Inc.
  27   28   */
  28   29  
  29   30  #ifndef _SYS_TIHDR_H
  30   31  #define _SYS_TIHDR_H
  31   32  
  32   33  #include <sys/types.h>
  33   34  /*
  34   35   * Include declarations implicit to TPI and shared with user level code
  35   36   */
  36   37  #include <sys/tpicommon.h>
↓ open down ↓ 136 lines elided ↑ open up ↑
 173  174   * T_EXTCONN_IND (extended T_CONN_IND) is used to return dst as well as
 174  175   * src addr/port.
 175  176   */
 176  177  #define T_OPTDATA_REQ   0x1001  /* data (with options) request  */
 177  178  #define T_OPTDATA_IND   0x1002  /* data (with options) indication */
 178  179  #define T_EXTCONN_IND   0x1003  /* extended T_CONN_IND to return dst as well */
 179  180  
 180  181  #endif /* _KERNEL */
 181  182  
 182  183  /*
 183      - * The following are the events that drive the state machine
 184      - */
 185      -/* Initialization events */
 186      -#define TE_BIND_REQ     0       /* bind request                         */
 187      -#define TE_UNBIND_REQ   1       /* unbind request                       */
 188      -#define TE_OPTMGMT_REQ  2       /* manage options req                   */
 189      -#define TE_BIND_ACK     3       /* bind acknowledment                   */
 190      -#define TE_OPTMGMT_ACK  4       /* manage options ack                   */
 191      -#define TE_ERROR_ACK    5       /* error acknowledgment                 */
 192      -#define TE_OK_ACK1      6       /* ok ack  seqcnt == 0                  */
 193      -#define TE_OK_ACK2      7       /* ok ack  seqcnt == 1, q == resq       */
 194      -#define TE_OK_ACK3      8       /* ok ack  seqcnt == 1, q != resq       */
 195      -#define TE_OK_ACK4      9       /* ok ack  seqcnt > 1                   */
 196      -
 197      -/* Connection oriented events */
 198      -#define TE_CONN_REQ     10      /* connection request                   */
 199      -#define TE_CONN_RES     11      /* connection response                  */
 200      -#define TE_DISCON_REQ   12      /* disconnect request                   */
 201      -#define TE_DATA_REQ     13      /* data request                         */
 202      -#define TE_EXDATA_REQ   14      /* expedited data request               */
 203      -#define TE_ORDREL_REQ   15      /* orderly release req                  */
 204      -#define TE_CONN_IND     16      /* connection indication                */
 205      -#define TE_CONN_CON     17      /* connection confirmation              */
 206      -#define TE_DATA_IND     18      /* data indication                      */
 207      -#define TE_EXDATA_IND   19      /* expedited data indication            */
 208      -#define TE_ORDREL_IND   20      /* orderly release ind                  */
 209      -#define TE_DISCON_IND1  21      /* disconnect indication seq == 0       */
 210      -#define TE_DISCON_IND2  22      /* disconnect indication seq == 1       */
 211      -#define TE_DISCON_IND3  23      /* disconnect indication seq > 1        */
 212      -#define TE_PASS_CONN    24      /* pass connection                      */
 213      -
 214      -/* Unit data events */
 215      -#define TE_UNITDATA_REQ 25      /* unitdata request                     */
 216      -#define TE_UNITDATA_IND 26      /* unitdata indication                  */
 217      -#define TE_UDERROR_IND  27      /* unitdata error indication            */
 218      -
 219      -#define TE_NOEVENTS     28
 220      -/*
 221  184   * The following are the possible states of the Transport
 222  185   * Service Interface
 223  186   */
 224  187  
 225  188  #define TS_UNBND                0       /* unbound                      */
 226  189  #define TS_WACK_BREQ            1       /* waiting ack of BIND_REQ      */
 227  190  #define TS_WACK_UREQ            2       /* waiting ack of UNBIND_REQ    */
 228  191  #define TS_IDLE                 3       /* idle                         */
 229  192  #define TS_WACK_OPTREQ          4       /* wait ack options request     */
 230  193  #define TS_WACK_CREQ            5       /* waiting ack of CONN_REQ      */
↓ open down ↓ 196 lines elided ↑ open up ↑
 427  390                                  /* SENDZERO defined in <sys/timod.h> */
 428  391  #else
 429  392  #define SENDZERO        0x1000  /* old SENDZERO value */
 430  393  #endif /* _SUN_TPI_VERSION > 0 */
 431  394  
 432  395  #define EXPINLINE       0x0002  /* provider wants ETSDUs in band 0 */
 433  396  /*
 434  397   * Flag XPG4_1:
 435  398   *              transport provider supports TPI modifications motivated by and
 436  399   *              in conjunction with XTI inspired TPI support and all the
 437      - *              compatibility baggage that implies.
      400 + *              compatibility baggage that implies.
 438  401   *    It implies, - primitives T_ADDR_REQ & T_ADDR_ACK supported
 439  402   *                - primitives O_T_BIND_REQ & T_BIND_REQ separately supported
 440  403   *                - primitives T_SVR4_OPTMGMT_REQ & T_OPTMGMT_REQ separately
 441  404   *                  supported.
 442  405   */
 443  406  #define XPG4_1          0x0004
 444  407  
 445  408  /* bind acknowledgment */
 446  409  
 447  410  struct T_bind_ack {
↓ open down ↓ 65 lines elided ↑ open up ↑
 513  476          t_scalar_t      REMADDR_length; /* length of remote address     */
 514  477          t_scalar_t      REMADDR_offset; /* offset of remote address     */
 515  478  };
 516  479  
 517  480  #if _SUN_TPI_VERSION > 1
 518  481  /*
 519  482   * Capability request and ack.  These primitives are optional and
 520  483   * subsume the functionality of T_INFO_{REQ,ACK}.
 521  484   */
 522  485  struct T_capability_req {
 523      -        t_scalar_t      PRIM_type;      /* always T_CAPABILITY_REQ      */
      486 +        t_scalar_t      PRIM_type;      /* always T_CAPABILITY_REQ      */
 524  487          t_uscalar_t     CAP_bits1;      /* capability bits #1           */
 525  488  };
 526  489  
 527  490  struct T_capability_ack {
 528      -        t_scalar_t      PRIM_type;      /* always T_CAPABILITY_ACK      */
      491 +        t_scalar_t      PRIM_type;      /* always T_CAPABILITY_ACK      */
 529  492          t_uscalar_t     CAP_bits1;      /* capability bits #1           */
 530  493          struct T_info_ack
 531  494                          INFO_ack;       /* info acknowledgement         */
 532  495          t_uscalar_t     ACCEPTOR_id;    /* accepting endpoint id        */
 533  496  };
 534  497  
 535  498  #define TC1_INFO        (1u << 0)       /* Info request/ack             */
 536  499  #define TC1_ACCEPTOR_ID (1u << 1)       /* Acceptor_id request/ack      */
 537  500  #define TC1_CAP_BITS2   (1u << 31)      /* Reserved for future use      */
 538  501  
↓ open down ↓ 225 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX