Print this page
3942 inject sanity into ipadm tcp buffer size properties
3943 _snd_lowat_fraction tcp tunable has no effect
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Peng Dai <peng.dai@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libipadm/common/ipadm_addr.c
          +++ new/usr/src/lib/libipadm/common/ipadm_addr.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2013 by Delphix. All rights reserved.
  23   24   */
  24   25  
  25   26  /*
  26   27   * This file contains functions for address management such as creating
  27   28   * an address, deleting an address, enabling an address, disabling an
  28   29   * address, bringing an address down or up, setting/getting properties
  29   30   * on an address object and listing address information
  30   31   * for all addresses in active as well as persistent configuration.
  31   32   */
  32   33  #include <sys/types.h>
↓ open down ↓ 56 lines elided ↑ open up ↑
  89   90  /*
  90   91   * Callback functions to set property values. These functions translate the
  91   92   * values to a format suitable for kernel consumption, allocate the necessary
  92   93   * ioctl buffers and then invoke ioctl().
  93   94   */
  94   95  static ipadm_pd_setf_t  i_ipadm_set_prefixlen, i_ipadm_set_addr_flag,
  95   96                          i_ipadm_set_zone;
  96   97  
  97   98  /* address properties description table */
  98   99  ipadm_prop_desc_t ipadm_addrprop_table[] = {
  99      -        { "broadcast", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
      100 +        { "broadcast", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
 100  101              NULL, NULL, i_ipadm_get_broadcast },
 101  102  
 102      -        { "deprecated", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
      103 +        { "deprecated", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
 103  104              i_ipadm_set_addr_flag, i_ipadm_get_onoff,
 104  105              i_ipadm_get_addr_flag },
 105  106  
 106      -        { "prefixlen", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
      107 +        { "prefixlen", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
 107  108              i_ipadm_set_prefixlen, i_ipadm_get_prefixlen,
 108  109              i_ipadm_get_prefixlen },
 109  110  
 110      -        { "private", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
      111 +        { "private", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
 111  112              i_ipadm_set_addr_flag, i_ipadm_get_onoff, i_ipadm_get_addr_flag },
 112  113  
 113      -        { "transmit", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
      114 +        { "transmit", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
 114  115              i_ipadm_set_addr_flag, i_ipadm_get_onoff, i_ipadm_get_addr_flag },
 115  116  
 116      -        { "zone", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
      117 +        { "zone", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
 117  118              i_ipadm_set_zone, NULL, i_ipadm_get_zone },
 118  119  
 119      -        { NULL, 0, 0, 0, NULL, NULL, NULL }
      120 +        { NULL, NULL, 0, 0, 0, NULL, NULL, NULL }
 120  121  };
 121  122  
 122      -static ipadm_prop_desc_t up_addrprop = { "up", IPADMPROP_CLASS_ADDR,
      123 +static ipadm_prop_desc_t up_addrprop = { "up", NULL, IPADMPROP_CLASS_ADDR,
 123  124                                          MOD_PROTO_NONE, 0, NULL, NULL, NULL };
 124  125  
 125  126  /*
 126  127   * Helper function that initializes the `ipadm_ifname', `ipadm_aobjname', and
 127  128   * `ipadm_atype' fields of the given `ipaddr'.
 128  129   */
 129  130  void
 130  131  i_ipadm_init_addr(ipadm_addrobj_t ipaddr, const char *ifname,
 131  132      const char *aobjname, ipadm_addr_type_t atype)
 132  133  {
↓ open down ↓ 1236 lines elided ↑ open up ↑
1369 1370  
1370 1371          return (IPADM_SUCCESS);
1371 1372  }
1372 1373  
1373 1374  static ipadm_prop_desc_t *
1374 1375  i_ipadm_get_addrprop_desc(const char *pname)
1375 1376  {
1376 1377          int i;
1377 1378  
1378 1379          for (i = 0; ipadm_addrprop_table[i].ipd_name != NULL; i++) {
1379      -                if (strcmp(pname, ipadm_addrprop_table[i].ipd_name) == 0)
     1380 +                if (strcmp(pname, ipadm_addrprop_table[i].ipd_name) == 0 ||
     1381 +                    (ipadm_addrprop_table[i].ipd_old_name != NULL &&
     1382 +                    strcmp(pname, ipadm_addrprop_table[i].ipd_old_name) == 0))
1380 1383                          return (&ipadm_addrprop_table[i]);
1381 1384          }
1382 1385          return (NULL);
1383 1386  }
1384 1387  
1385 1388  /*
1386 1389   * Gets the value of the given address property `pname' for the address
1387 1390   * object with name `aobjname'.
1388 1391   */
1389 1392  ipadm_status_t
↓ open down ↓ 2204 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX