Print this page
OS-1573 vnic_dev.c insufficiently explicit
*** 50,59 ****
--- 50,60 ----
#include <sys/pattr.h>
#include <sys/time.h>
#include <sys/vlan.h>
#include <sys/vnic.h>
#include <sys/vnic_impl.h>
+ #include <sys/mac_impl.h>
#include <sys/mac_flow_impl.h>
#include <inet/ip_impl.h>
/*
* Note that for best performance, the VNIC is a passthrough design.
*** 845,864 ****
/*ARGSUSED*/
static int
vnic_m_setprop(void *m_driver, const char *pr_name, mac_prop_id_t pr_num,
uint_t pr_valsize, const void *pr_val)
{
! int err = ENOTSUP;
vnic_t *vn = m_driver;
switch (pr_num) {
case MAC_PROP_MTU: {
uint32_t mtu;
/* allow setting MTU only on an etherstub */
! if (vn->vn_link_id != DATALINK_INVALID_LINKID)
! return (err);
if (pr_valsize < sizeof (mtu)) {
err = EINVAL;
break;
}
--- 846,867 ----
/*ARGSUSED*/
static int
vnic_m_setprop(void *m_driver, const char *pr_name, mac_prop_id_t pr_num,
uint_t pr_valsize, const void *pr_val)
{
! int err = 0;
vnic_t *vn = m_driver;
switch (pr_num) {
case MAC_PROP_MTU: {
uint32_t mtu;
/* allow setting MTU only on an etherstub */
! if (vn->vn_link_id != DATALINK_INVALID_LINKID) {
! err = ENOTSUP;
! break;
! }
if (pr_valsize < sizeof (mtu)) {
err = EINVAL;
break;
}
*** 877,889 ****
err = EINVAL;
break;
}
bcopy(pr_val, &filtered, sizeof (filtered));
! err = mac_set_promisc_filtered(vn->vn_mch, filtered);
}
default:
break;
}
return (err);
}
--- 880,893 ----
err = EINVAL;
break;
}
bcopy(pr_val, &filtered, sizeof (filtered));
! mac_set_promisc_filtered(vn->vn_mch, filtered);
}
default:
+ err = ENOTSUP;
break;
}
return (err);
}