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>

@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
 /*
  * This file contains functions for address management such as creating
  * an address, deleting an address, enabling an address, disabling an

@@ -94,34 +95,34 @@
 static ipadm_pd_setf_t  i_ipadm_set_prefixlen, i_ipadm_set_addr_flag,
                         i_ipadm_set_zone;
 
 /* address properties description table */
 ipadm_prop_desc_t ipadm_addrprop_table[] = {
-        { "broadcast", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
+        { "broadcast", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
             NULL, NULL, i_ipadm_get_broadcast },
 
-        { "deprecated", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
+        { "deprecated", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
             i_ipadm_set_addr_flag, i_ipadm_get_onoff,
             i_ipadm_get_addr_flag },
 
-        { "prefixlen", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
+        { "prefixlen", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
             i_ipadm_set_prefixlen, i_ipadm_get_prefixlen,
             i_ipadm_get_prefixlen },
 
-        { "private", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
+        { "private", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
             i_ipadm_set_addr_flag, i_ipadm_get_onoff, i_ipadm_get_addr_flag },
 
-        { "transmit", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
+        { "transmit", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
             i_ipadm_set_addr_flag, i_ipadm_get_onoff, i_ipadm_get_addr_flag },
 
-        { "zone", IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
+        { "zone", NULL, IPADMPROP_CLASS_ADDR, MOD_PROTO_NONE, 0,
             i_ipadm_set_zone, NULL, i_ipadm_get_zone },
 
-        { NULL, 0, 0, 0, NULL, NULL, NULL }
+        { NULL, NULL, 0, 0, 0, NULL, NULL, NULL }
 };
 
-static ipadm_prop_desc_t up_addrprop = { "up", IPADMPROP_CLASS_ADDR,
+static ipadm_prop_desc_t up_addrprop = { "up", NULL, IPADMPROP_CLASS_ADDR,
                                         MOD_PROTO_NONE, 0, NULL, NULL, NULL };
 
 /*
  * Helper function that initializes the `ipadm_ifname', `ipadm_aobjname', and
  * `ipadm_atype' fields of the given `ipaddr'.

@@ -1374,11 +1375,13 @@
 i_ipadm_get_addrprop_desc(const char *pname)
 {
         int i;
 
         for (i = 0; ipadm_addrprop_table[i].ipd_name != NULL; i++) {
-                if (strcmp(pname, ipadm_addrprop_table[i].ipd_name) == 0)
+                if (strcmp(pname, ipadm_addrprop_table[i].ipd_name) == 0 ||
+                    (ipadm_addrprop_table[i].ipd_old_name != NULL &&
+                    strcmp(pname, ipadm_addrprop_table[i].ipd_old_name) == 0))
                         return (&ipadm_addrprop_table[i]);
         }
         return (NULL);
 }