Print this page
13175 Add support for IP_RECVTOS
13182 CMSG_ macros should have man pages
Change-ID: I784aa36cfd3c17e3cccbf1fd329fa7e69b663ef9

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/udp/udp.c
          +++ new/usr/src/uts/common/inet/udp/udp.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  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   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   24   * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
       25 + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  25   26   */
  26   27  /* Copyright (c) 1990 Mentat Inc. */
  27   28  
  28   29  #include <sys/sysmacros.h>
  29   30  #include <sys/types.h>
  30   31  #include <sys/stream.h>
  31   32  #include <sys/stropts.h>
  32   33  #include <sys/strlog.h>
  33   34  #include <sys/strsun.h>
  34   35  #define _SUN_TPI_VERSION 2
↓ open down ↓ 2305 lines elided ↑ open up ↑
2340 2341                  udi_size -= (sizeof (struct T_unitdata_ind) + sizeof (sin_t));
2341 2342                  tudi->OPT_length = udi_size;
2342 2343                  sin = (sin_t *)&tudi[1];
2343 2344                  sin->sin_addr.s_addr = ((ipha_t *)rptr)->ipha_src;
2344 2345                  sin->sin_port = udpha->uha_src_port;
2345 2346                  sin->sin_family = connp->conn_family;
2346 2347                  *(uint32_t *)&sin->sin_zero[0] = 0;
2347 2348                  *(uint32_t *)&sin->sin_zero[4] = 0;
2348 2349  
2349 2350                  /*
2350      -                 * Add options if IP_RECVDSTADDR, IP_RECVIF, IP_RECVSLLA or
2351      -                 * IP_RECVTTL has been set.
     2351 +                 * Add options if IP_RECVDSTADDR, IP_RECVIF, IP_RECVSLLA,
     2352 +                 * IP_RECVTTL or IP_RECVTOS has been set.
2352 2353                   */
2353 2354                  if (udi_size != 0) {
2354 2355                          conn_recvancillary_add(connp, recv_ancillary, ira,
2355 2356                              &ipps, (uchar_t *)&sin[1], udi_size);
2356 2357                  }
2357 2358          } else {
2358 2359                  sin6_t *sin6;
2359 2360  
2360 2361                  /*
2361 2362                   * Handle both IPv4 and IPv6 packets for IPv6 sockets.
↓ open down ↓ 4112 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX