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) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 /* Copyright (c) 1990 Mentat Inc. */
 
 #include <inet/ip.h>
 #include <inet/ip6.h>

@@ -42,19 +43,19 @@
  * find the ill and set the value on it. On the other hand if we are modifying
  * global property, modify the global value and set the value on all the ills.
  */
 /* ARGSUSED */
 static int
-ip_set_forwarding(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
+ip_set_forwarding(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
     const char *ifname, const void* pval, uint_t flags)
 {
         char                    *end;
         unsigned long           new_value;
         boolean_t               per_ill, isv6;
         ill_walk_context_t      ctx;
         ill_t                   *ill;
-        ip_stack_t              *ipst = (ip_stack_t *)cbarg;
+        ip_stack_t              *ipst = stack->netstack_ip;
 
         if (flags & MOD_PROP_DEFAULT) {
                 new_value = pinfo->prop_def_bval;
         } else {
                 if (ddi_strtoul(pval, &end, 10, &new_value) != 0 ||

@@ -92,17 +93,17 @@
 
         return (0);
 }
 
 static int
-ip_get_forwarding(void *cbarg, mod_prop_info_t *pinfo, const char *ifname,
+ip_get_forwarding(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
     void *pval, uint_t pr_size, uint_t flags)
 {
         boolean_t               value;
         ill_walk_context_t      ctx;
         ill_t                   *ill;
-        ip_stack_t              *ipst =  (ip_stack_t *)cbarg;
+        ip_stack_t              *ipst = stack->netstack_ip;
         boolean_t               get_def = (flags & MOD_PROP_DEFAULT);
         boolean_t               get_perm = (flags & MOD_PROP_PERM);
         boolean_t               isv6;
         size_t                  nbytes = 0;
 

@@ -154,11 +155,11 @@
  * `ip_debug' is a global variable. So, we will be modifying the global
  * variable here.
  */
 /* ARGSUSED */
 int
-ip_set_debug(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
+ip_set_debug(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
     const char *ifname, const void* pval, uint_t flags)
 {
         unsigned long   new_value;
         int             err;
 

@@ -176,11 +177,11 @@
  * we retrieve the value from `pinfo'. However for the current value we
  * retrieve the value from the global variable `ip_debug'
  */
 /* ARGSUSED */
 int
-ip_get_debug(void *cbarg, mod_prop_info_t *pinfo, const char *ifname,
+ip_get_debug(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
     void *pval, uint_t psize, uint_t flags)
 {
         boolean_t       get_def = (flags & MOD_PROP_DEFAULT);
         boolean_t       get_perm = (flags & MOD_PROP_PERM);
         boolean_t       get_range = (flags & MOD_PROP_POSSIBLE);

@@ -206,15 +207,15 @@
  * from active to transparent or from transparent to active, forward the
  * new status to the filtering module (if loaded).
  */
 /* ARGSUSED */
 static int
-ip_set_cgtp_filter(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
+ip_set_cgtp_filter(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
     const char *ifname, const void* pval, uint_t flags)
 {
         unsigned long   new_value;
-        ip_stack_t      *ipst = (ip_stack_t *)cbarg;
+        ip_stack_t      *ipst = stack->netstack_ip;
         char            *end;
 
         if (flags & MOD_PROP_DEFAULT) {
                 new_value = pinfo->prop_def_bval;
         } else {

@@ -263,16 +264,16 @@
  *
  *  -- ill_user_mtu is set by in.ndpd using SIOCSLIFLNKINFO and must lie between
  *     (IPV6_MIN_MTU/IP_MIN_MTU) and ill_max_frag.
  */
 int
-ip_get_mtu(void *cbarg, mod_prop_info_t *pinfo, const char *ifname,
+ip_get_mtu(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
     void *pval, uint_t psize, uint_t flags)
 {
         ill_walk_context_t      ctx;
         ill_t                   *ill;
-        ip_stack_t              *ipst =  (ip_stack_t *)cbarg;
+        ip_stack_t              *ipst = stack->netstack_ip;
         boolean_t               isv6;
         uint32_t                max_mtu, def_mtu;
         size_t                  nbytes = 0;
 
         if (!(flags & (MOD_PROP_DEFAULT|MOD_PROP_POSSIBLE)))

@@ -350,16 +351,16 @@
         }
 }
 
 /* ARGSUSED */
 static int
-ip_set_src_multihoming(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
+ip_set_src_multihoming(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
     const char *ifname, const void* pval, uint_t flags)
 {
         unsigned long   new_value, old_value;
         boolean_t       isv6;
-        ip_stack_t      *ipst = (ip_stack_t *)cbarg;
+        ip_stack_t      *ipst = stack->netstack_ip;
         int             err;
 
         old_value = pinfo->prop_cur_uval;
 
         if ((err = mod_uint32_value(pval, pinfo, flags, &new_value)) != 0)

@@ -371,15 +372,15 @@
 }
 
 
 /* ARGSUSED */
 static int
-ip_set_hostmodel(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
+ip_set_hostmodel(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
     const char *ifname, const void* pval, uint_t flags)
 {
         ip_hostmodel_t  new_value, old_value;
-        ip_stack_t      *ipst = (ip_stack_t *)cbarg;
+        ip_stack_t      *ipst = stack->netstack_ip;
         uint32_t        old_src_multihoming;
         int             err;
         ulong_t         tmp;
         boolean_t       isv6;
 

@@ -444,15 +445,15 @@
         return (0);
 }
 
 /* ARGSUSED */
 int
-ip_get_hostmodel(void *cbarg, mod_prop_info_t *pinfo, const char *ifname,
+ip_get_hostmodel(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
     void *pval, uint_t psize, uint_t flags)
 {
         boolean_t       isv6 = (pinfo->mpi_proto == MOD_PROTO_IPV6);
-        ip_stack_t      *ipst = cbarg;
+        ip_stack_t      *ipst = stack->netstack_ip;
         ip_hostmodel_t  hostmodel;
 
         if (psize < sizeof (hostmodel))
                 return (ENOBUFS);
         bzero(pval, psize);