diff options
Diffstat (limited to 'drivers/net/hyperv')
| -rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 2 | ||||
| -rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 11 | ||||
| -rw-r--r-- | drivers/net/hyperv/rndis_filter.c | 10 | 
3 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 5fd6f467432..e6fe0d80d61 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 f825a629a69..5f85205cd12 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -304,9 +304,9 @@ int netvsc_recv_callback(struct hv_device *device_obj,  static void netvsc_get_drvinfo(struct net_device *net,  			       struct ethtool_drvinfo *info)  { -	strcpy(info->driver, KBUILD_MODNAME); -	strcpy(info->version, HV_DRV_VERSION); -	strcpy(info->fw_version, "N/A"); +	strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); +	strlcpy(info->version, HV_DRV_VERSION, sizeof(info->version)); +	strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));  }  static int netvsc_change_mtu(struct net_device *ndev, int mtu) @@ -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; @@ -498,8 +498,7 @@ static int netvsc_remove(struct hv_device *dev)  static const struct hv_vmbus_device_id id_table[] = {  	/* Network guid */ -	{ VMBUS_DEVICE(0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, -		       0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E) }, +	{ HV_NIC_GUID, },  	{ },  }; diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 928148cc322..2b657d4d63a 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -363,11 +363,6 @@ static void rndis_filter_receive_data(struct rndis_device *dev,  	rndis_pkt = &msg->msg.pkt; -	/* -	 * FIXME: Handle multiple rndis pkt msgs that maybe enclosed in this -	 * netvsc packet (ie TotalDataBufferLength != MessageLength) -	 */ -  	/* Remove the rndis header and pass it back up the stack */  	data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; @@ -610,8 +605,11 @@ int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac)  		return -EBUSY;  	} else {  		set_complete = &request->response_msg.msg.set_complete; -		if (set_complete->status != RNDIS_STATUS_SUCCESS) +		if (set_complete->status != RNDIS_STATUS_SUCCESS) { +			netdev_err(ndev, "Fail to set MAC on host side:0x%x\n", +				   set_complete->status);  			ret = -EINVAL; +		}  	}  cleanup:  |