Patchwork [v3] net/hyperv: fix wrong length of mac address

login
register
mail settings
Submitter Jianjun Kong
Date Jan. 19, 2013, 2:52 a.m.
Message ID <1358563929-10942-1-git-send-email-kongjianjun@gmail.com>
Download mbox | patch
Permalink /patch/213779/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jianjun Kong - Jan. 19, 2013, 2:52 a.m.
This patch fixed wrong mac length, it should be ETH_ALEN,
also replaced the hardcode 6 in hyperv_net.h

Signed-off-by: Amos Kong <kongjianjun@gmail.com>
---
v2: update commitlog, fix cc list
v3: fix hardcode length in hyperv_net.h
---
 drivers/net/hyperv/hyperv_net.h | 2 +-
 drivers/net/hyperv/netvsc_drv.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Haiyang Zhang - Jan. 19, 2013, 3:07 p.m.
> From: Amos Kong

> Sent: Friday, January 18, 2013 9:52 PM
> To: davem@davemloft.net; KY Srinivasan; Haiyang Zhang
> Cc: netdev@vger.kernel.org; devel@linuxdriverproject.org; Amos Kong
> Subject: [PATCH v3] net/hyperv: fix wrong length of mac address
> 
> This patch fixed wrong mac length, it should be ETH_ALEN,
> also replaced the hardcode 6 in hyperv_net.h
> 
> Signed-off-by: Amos Kong <kongjianjun@gmail.com>
> ---
> v2: update commitlog, fix cc list
> v3: fix hardcode length in hyperv_net.h
> ---

 Acked-by: Haiyang Zhang <haiyangz@microsoft.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Jan. 19, 2013, 4:02 p.m.
From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Sat, 19 Jan 2013 15:07:14 +0000

>> From: Amos Kong
> 
>> Sent: Friday, January 18, 2013 9:52 PM
>> To: davem@davemloft.net; KY Srinivasan; Haiyang Zhang
>> Cc: netdev@vger.kernel.org; devel@linuxdriverproject.org; Amos Kong
>> Subject: [PATCH v3] net/hyperv: fix wrong length of mac address
>> 
>> This patch fixed wrong mac length, it should be ETH_ALEN,
>> also replaced the hardcode 6 in hyperv_net.h
>> 
>> Signed-off-by: Amos Kong <kongjianjun@gmail.com>
>> ---
>> v2: update commitlog, fix cc list
>> v3: fix hardcode length in hyperv_net.h
>> ---
> 
>  Acked-by: Haiyang Zhang <haiyangz@microsoft.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 5fd6f46..e6fe0d8 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -84,7 +84,7 @@  struct hv_netvsc_packet {
 };
 
 struct netvsc_device_info {
-	unsigned char mac_adr[6];
+	unsigned char mac_adr[ETH_ALEN];
 	bool link_state;	/* 0 - link up, 1 - link down */
 	int  ring_size;
 };
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index f825a62..8264f0e 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -349,7 +349,7 @@  static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
 	struct net_device_context *ndevctx = netdev_priv(ndev);
 	struct hv_device *hdev =  ndevctx->device_ctx;
 	struct sockaddr *addr = p;
-	char save_adr[14];
+	char save_adr[ETH_ALEN];
 	unsigned char save_aatype;
 	int err;