Print this page
11849 listen of IPv6 address fails with EAFNOSUPPORT

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp/tcp.c
          +++ new/usr/src/uts/common/inet/tcp/tcp.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2011, Joyent Inc. All rights reserved.
       24 + * Copyright 2019 Joyent, Inc.
  25   25   * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  26   26   * Copyright (c) 2013, 2017 by Delphix. All rights reserved.
  27   27   * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
  28   28   */
  29   29  /* Copyright (c) 1990 Mentat Inc. */
  30   30  
  31   31  #include <sys/types.h>
  32   32  #include <sys/stream.h>
  33   33  #include <sys/strsun.h>
  34   34  #include <sys/strsubr.h>
↓ open down ↓ 4292 lines elided ↑ open up ↑
4327 4327                           * might be "stolen" between the unbind and bind.
4328 4328                           */
4329 4329                          goto do_listen;
4330 4330                  }
4331 4331                  if (connp->conn_debug) {
4332 4332                          (void) strlog(TCP_MOD_ID, 0, 1, SL_ERROR|SL_TRACE,
4333 4333                              "tcp_listen: bad state, %d", tcp->tcp_state);
4334 4334                  }
4335 4335                  return (-TOUTSTATE);
4336 4336          } else {
4337      -                if (sa == NULL) {
4338      -                        sin6_t  addr;
4339      -                        sin_t *sin;
4340      -                        sin6_t *sin6;
     4337 +                sin6_t  addr;
     4338 +                sin_t *sin;
     4339 +                sin6_t *sin6;
4341 4340  
     4341 +                if (sa == NULL) {
4342 4342                          ASSERT(IPCL_IS_NONSTR(connp));
4343 4343                          /* Do an implicit bind: Request for a generic port. */
4344 4344                          if (connp->conn_family == AF_INET) {
4345 4345                                  len = sizeof (sin_t);
4346 4346                                  sin = (sin_t *)&addr;
4347 4347                                  *sin = sin_null;
4348 4348                                  sin->sin_family = AF_INET;
4349 4349                          } else {
4350 4350                                  ASSERT(connp->conn_family == AF_INET6);
4351 4351                                  len = sizeof (sin6_t);
↓ open down ↓ 129 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX