Print this page
OS-1573 vnic_dev.c insufficiently explicit

@@ -50,10 +50,11 @@
 #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,20 +846,22 @@
 /*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;
+        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)
-                        return (err);
+                if (vn->vn_link_id != DATALINK_INVALID_LINKID) {
+                        err = ENOTSUP;
+                        break;
+                }
 
                 if (pr_valsize < sizeof (mtu)) {
                         err = EINVAL;
                         break;
                 }

@@ -877,13 +880,14 @@
                         err = EINVAL;
                         break;
                 }
 
                 bcopy(pr_val, &filtered, sizeof (filtered));
-                err = mac_set_promisc_filtered(vn->vn_mch, filtered);
+                mac_set_promisc_filtered(vn->vn_mch, filtered);
         }
         default:
+                err = ENOTSUP;
                 break;
         }
         return (err);
 }