Thread (5 messages) flat view 5 messages, 2 authors, 2012-07-10

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

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2012-07-10 17:04:03
Also in: lkml

-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@solarflare.com]
Sent: Friday, July 06, 2012 8:19 PM
To: Haiyang Zhang
Cc: davem@davemloft.net; netdev@vger.kernel.org; KY Srinivasan;
olaf@aepfle.de; linux-kernel@vger.kernel.org;
devel@linuxdriverproject.org
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:
quoted
This adds support for setting synthetic NIC MAC address from within
Linux
quoted
guests. Before using this feature, the option "spoofing of MAC
address"
quoted
should be enabled at the Hyper-V manager / Settings of the synthetic
NIC.
[...]
quoted
+int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac)
+{
[...]
quoted
+	t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+	if (t == 0) {
+		netdev_err(ndev, "timeout before we got a set
response...\n");
quoted
+		/*
+		 * 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?
I have check the return code, 0xc000000d, which is returned both when MAC
spoofing is not enabled or the parameter contains other errors. So we can't
tell if it permission error or not. I will re-submit this patch still
using EINVAL.

Thanks,
- Haiyang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help