Print this page
10085 sctp_getpeeraddrs() doesn't need to check for a NULL primary

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/sctp/sctp_opt_data.c
          +++ new/usr/src/uts/common/inet/sctp/sctp_opt_data.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright (c) 2018, Joyent, Inc.
       28 + */
       29 +
  26   30  #include <sys/types.h>
  27   31  #include <sys/stream.h>
  28   32  #define _SUN_TPI_VERSION 2
  29   33  #include <sys/tihdr.h>
  30   34  #include <sys/socket.h>
  31   35  #include <sys/xti_inet.h>
  32   36  #include <sys/systm.h>
  33   37  #include <sys/ddi.h>
  34   38  #include <sys/sunddi.h>
  35   39  #include <sys/kmem.h>
↓ open down ↓ 1450 lines elided ↑ open up ↑
1486 1490                          sin4->sin_family = AF_INET;
1487 1491                          break;
1488 1492  
1489 1493                  case AF_INET6:
1490 1494                          sin6 = paddrs;
1491 1495                          sin6->sin6_addr = addr;
1492 1496                          sin6->sin6_port = connp->conn_fport;
1493 1497                          sin6->sin6_family = AF_INET6;
1494 1498                          sin6->sin6_flowinfo = connp->conn_flowinfo;
1495 1499                          if (IN6_IS_ADDR_LINKSCOPE(&addr) &&
1496      -                            sctp->sctp_primary != NULL &&
1497 1500                              (sctp->sctp_primary->sf_ixa->ixa_flags &
1498 1501                              IXAF_SCOPEID_SET)) {
1499 1502                                  sin6->sin6_scope_id =
1500 1503                                      sctp->sctp_primary->sf_ixa->ixa_scopeid;
1501 1504                          } else {
1502 1505                                  sin6->sin6_scope_id = 0;
1503 1506                          }
1504 1507                          sin6->__sin6_src_id = 0;
1505 1508                          break;
1506 1509                  }
↓ open down ↓ 31 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX