summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/io/mac/mac_ndd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/io/mac/mac_ndd.c')
-rw-r--r--usr/src/uts/common/io/mac/mac_ndd.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/usr/src/uts/common/io/mac/mac_ndd.c b/usr/src/uts/common/io/mac/mac_ndd.c
index 9d4fc4bc18..cf99ef64be 100644
--- a/usr/src/uts/common/io/mac/mac_ndd.c
+++ b/usr/src/uts/common/io/mac/mac_ndd.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/mac.h>
#include <sys/mac_impl.h>
+#include <sys/mac_client_priv.h>
#include <inet/nd.h>
#include <sys/mac_ether.h>
#include <sys/policy.h>
@@ -95,17 +96,16 @@ mac_ndd_get_names(mac_impl_t *mip, mblk_t *mp)
{
int size_out, i;
mblk_t *tmp;
- mac_priv_prop_t *mpriv;
uint_t permflags;
int status;
uint64_t value;
+ char *prop_name;
if (!mac_add_name(mp, "?", MAC_PROP_PERM_READ))
return (-1);
/* first the known ndd mappings */
for (i = 0; i < mip->mi_type->mt_mappingcount; i++) {
- permflags = MAC_PROP_PERM_RW;
if ((mip->mi_type->mt_mapping[i].mp_flags & MAC_PROP_MAP_KSTAT)
!= 0)
permflags = MAC_PROP_PERM_READ;
@@ -113,8 +113,13 @@ mac_ndd_get_names(mac_impl_t *mip, mblk_t *mp)
status = mip->mi_callbacks->mc_getprop(mip->mi_driver,
mip->mi_type->mt_mapping[i].mp_name,
mip->mi_type->mt_mapping[i].mp_prop_id,
- 0, mip->mi_type->mt_mapping[i].mp_valsize,
- &value, &permflags);
+ mip->mi_type->mt_mapping[i].mp_valsize, &value);
+ if (status != 0)
+ continue;
+ status = mac_prop_info((mac_handle_t)mip,
+ mip->mi_type->mt_mapping[i].mp_prop_id,
+ mip->mi_type->mt_mapping[i].mp_name, NULL, 0,
+ NULL, &permflags);
if (status != 0)
continue;
}
@@ -126,10 +131,14 @@ mac_ndd_get_names(mac_impl_t *mip, mblk_t *mp)
/* now the driver's ndd variables */
for (i = 0; i < mip->mi_priv_prop_count; i++) {
- mpriv = &mip->mi_priv_prop[i];
+ prop_name = mip->mi_priv_prop[i];
+
+ if (mac_prop_info((mac_handle_t)mip, MAC_PROP_PRIVATE,
+ prop_name, NULL, 0, NULL, &permflags) != 0)
+ return (-1);
/* skip over the "_" */
- if (!mac_add_name(mp, &mpriv->mpp_name[1], mpriv->mpp_flags))
+ if (!mac_add_name(mp, &prop_name[1], permflags))
return (-1);
}
@@ -185,7 +194,6 @@ mac_ndd_get_ioctl(mac_impl_t *mip, mblk_t *mp, int avail, int *rval)
uint16_t u16;
uint32_t u32;
uint64_t u64;
- uint_t perm;
if (mp->b_cont == NULL || avail < 2)
return (EINVAL);
@@ -258,9 +266,8 @@ mac_ndd_get_ioctl(mac_impl_t *mip, mblk_t *mp, int avail, int *rval)
new_value = u32 = (long)u64;
} else {
status = mip->mi_callbacks->mc_getprop(mip->mi_driver,
- name, mip->mi_type->mt_mapping[i].mp_prop_id, 0,
- mip->mi_type->mt_mapping[i].mp_valsize, value,
- &perm);
+ name, mip->mi_type->mt_mapping[i].mp_prop_id,
+ mip->mi_type->mt_mapping[i].mp_valsize, value);
switch (mip->mi_type->mt_mapping[i].mp_valsize) {
case 1:
new_value = u8;
@@ -294,7 +301,7 @@ mac_ndd_get_ioctl(mac_impl_t *mip, mblk_t *mp, int avail, int *rval)
*/
(void) snprintf(priv_name, sizeof (priv_name), "_%s", name);
status = mip->mi_callbacks->mc_getprop(mip->mi_driver, priv_name,
- MAC_PROP_PRIVATE, 0, avail - 2, mp1->b_rptr, &perm);
+ MAC_PROP_PRIVATE, avail - 2, mp1->b_rptr);
if (status != 0)
goto get_done;