net: fix wrong length of mac address
Subsystems (3)
PATCH v2 1/1 net: fix wrong length of mac address
Typo, it should be ETH_ALEN.
---
v2: update commitlog, fix cc list
--- drivers/net/hyperv/netvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hyperv/netvsc_drv.c +1 -1
@@ -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;
Signature · 1 line
1.7.11.7
Quoted 14 lines · Amos Kong
Typo, it should be
ETH_ALEN.Signed-off-by Amos Kong <[email protected]>---
v2: update commitlog, fix cc list--- drivers/net/hyperv/netvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/hyperv/netvsc_drv.c +0
-0
drivers/net/hyperv/netvsc_drv.c static int netvsc_set_mac_addr(struct net_device *ndev, void *p) · line 354
Quoted 7 lines
drivers/net/hyperv/netvsc_drv.c +1
-1@@ -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;
While you're at it, you should fix drivers/net/hyperv/hyperv_net.h:
struct netvsc_device_info {
drivers/net/hyperv/netvsc_drv.c static int netvsc_set_mac_addr(struct net_device *ndev, void *p) · line 355
Quoted 1 line
drivers/net/hyperv/netvsc_drv.c +0
-0>> unsigned char mac_adr[6];
bool link_state; /* 0 - link up, 1 - link down */
int ring_size;
};
Cheers,
-PJ
A message that is not in the archive (sent off-list or not yet received): [email protected]
David Miller
maintainerFrom: PJ Waskiewicz <WaskiewiczJr@ppwaskie-mobl2>
Date: Fri, 18 Jan 2013 00:30:32 -0800
Quoted 26 lines · Amos Kong
Quoted 14 lines
Typo, it should be
ETH_ALEN.Signed-off-by Amos Kong <[email protected]>---
v2: update commitlog, fix cc list--- drivers/net/hyperv/netvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/hyperv/netvsc_drv.c +0
-0drivers/net/hyperv/netvsc_drv.c static int netvsc_set_mac_addr(struct net_device *ndev, void *p) · line 354
Quoted 7 lines
drivers/net/hyperv/netvsc_drv.c +1
-1@@ -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;While you're at it, you should also update
drivers/net/hyperv/hyperv_net.hto also fix themac_adrdefinition in structnetvsc_device_info:
Quoted 2 lines
struct
netvsc_device_info{Quoted 1 line
drivers/net/hyperv/netvsc_drv.c +0
-0>> unsigned char mac_adr[6];
Agreed.
PATCH v3 1/1 net/hyperv: fix wrong length of mac address
In reply to a message not in the archiveThis patch fixed wrong mac length, it should be ETH_ALEN, also replaced the hardcode 6 in hyperv_net.h
---
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(-)
drivers/net/hyperv/hyperv_net.h +1 -1
@@ -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; };
drivers/net/hyperv/netvsc_drv.c +1 -1
@@ -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;
Signature · 1 line
1.7.11.7
RE: [PATCH v3] net/hyperv: fix wrong length of mac address
Quoted 7 lines
From: Amos Kong
Sent: Friday, January 18, 2013 9:52 PM
To: [email protected]; KY Srinivasan; Haiyang Zhang
Cc: [email protected]; [email protected]; Amos Kong
Subject: [PATCH v3] net/hyperv: fix wrong length of mac address
Quoted 8 lines
This patch fixed wrong mac length, it should be
ETH_ALEN, also replaced the hardcode 6 inhyperv_net.hSigned-off-by Amos Kong <[email protected]>---
v2: update commitlog, fix cc list
v3: fix hardcode length inhyperv_net.h
---
Re: [PATCH v3] net/hyperv: fix wrong length of mac address
From: Haiyang Zhang <[email protected]>
Date: Sat, 19 Jan 2013 15:07:14 +0000
Quoted 10 lines
Quoted 10 lines
From: Amos Kong
Sent: Friday, January 18, 2013 9:52 PM
To: [email protected]; KY Srinivasan; Haiyang Zhang
Cc: [email protected]; [email protected]; Amos Kong
Subject: [PATCH v3] net/hyperv: fix wrong length of mac addressThis patch fixed wrong mac length, it should be
ETH_ALEN, also replaced the hardcode 6 inhyperv_net.h
Quoted 7 lines
Quoted 5 lines
Signed-off-by Amos Kong <[email protected]>---
v2: update commitlog, fix cc list
v3: fix hardcode length inhyperv_net.h
---Acked-by Haiyang Zhang <[email protected]>
Applied, thanks.