Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328435
b: refs/heads/master
c: a3a6cab
h: refs/heads/master
i:
  328433: 21c1506
  328431: 5ab4a88
v: v3
  • Loading branch information
Haiyang Zhang authored and David S. Miller committed Oct 2, 2012
1 parent c64efe4 commit fa59397
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63f6921d300c6fbdca3d0e73dcc24b4e5e4dced2
refs/heads/master: a3a6cab5ea10cca64d036851fe0d932448f2fe4f
22 changes: 12 additions & 10 deletions trunk/drivers/net/hyperv/rndis_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@
#include "hyperv_net.h"


#define RNDIS_EXT_LEN 100
struct rndis_request {
struct list_head list_ent;
struct completion wait_event;

struct rndis_message response_msg;
/*
* FIXME: We assumed a fixed size response here. If we do ever need to
* handle a bigger response, we can either define a max response
* message or add a response buffer variable above this field
* The buffer for extended info after the RNDIS response message. It's
* referenced based on the data offset in the RNDIS message. Its size
* is enough for current needs, and should be sufficient for the near
* future.
*/
struct rndis_message response_msg;
u8 response_ext[RNDIS_EXT_LEN];

/* Simplify allocation by having a netvsc packet inline */
struct hv_netvsc_packet pkt;
Expand All @@ -50,12 +53,10 @@ struct rndis_request {

struct rndis_message request_msg;
/*
* The buffer for the extended info after the RNDIS message. It's
* referenced based on the data offset in the RNDIS message. Its size
* is enough for current needs, and should be sufficient for the near
* future.
* The buffer for the extended info after the RNDIS request message.
* It is referenced and sized in a similar way as response_ext.
*/
u8 ext[100];
u8 request_ext[RNDIS_EXT_LEN];
};

static void rndis_filter_send_completion(void *ctx);
Expand Down Expand Up @@ -274,7 +275,8 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
spin_unlock_irqrestore(&dev->request_lock, flags);

if (found) {
if (resp->msg_len <= sizeof(struct rndis_message)) {
if (resp->msg_len <=
sizeof(struct rndis_message) + RNDIS_EXT_LEN) {
memcpy(&request->response_msg, resp,
resp->msg_len);
} else {
Expand Down

0 comments on commit fa59397

Please sign in to comment.