RE: [PATCH net,1/1] hyperv: Add support for setting MAC from withinguests

From: Haiyang Zhang
Date: Sat Jul 07 2012 - 20:29:39 EST




> -----Original Message-----
> From: Ben Hutchings [mailto:bhutchings@xxxxxxxxxxxxxx]
> Sent: Friday, July 06, 2012 8:19 PM
> To: Haiyang Zhang
> Cc: davem@xxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; KY Srinivasan;
> olaf@xxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; devel@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH net,1/1] hyperv: Add support for setting MAC from
> within guests
>
> On Fri, 2012-07-06 at 14:25 -0700, Haiyang Zhang wrote:
> > This adds support for setting synthetic NIC MAC address from within
> > Linux guests. Before using this feature, the option "spoofing of MAC
> address"
> > should be enabled at the Hyper-V manager / Settings of the synthetic
> > NIC.
> [...]
> > +int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac) {
> [...]
> > + t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
> > + if (t == 0) {
> > + netdev_err(ndev, "timeout before we got a set
> response...\n");
> > + /*
> > + * can't put_rndis_request, since we may still receive a
> > + * send-completion.
> > + */
> > + return -EBUSY;
> > + } else {
> > + set_complete = &request->response_msg.msg.set_complete;
> > + if (set_complete->status != RNDIS_STATUS_SUCCESS)
> > + ret = -EINVAL;
> [...]
>
> Is there a specific error code that indicates the hypervisor is configured not
> to allow MAC address changes? If so, shouldn't that be translated to return
> EPERM rather than EINVAL?

Will do.

Thanks,
- Haiyang

N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i