Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368693
b: refs/heads/master
c: 9b4d669
h: refs/heads/master
i:
  368691: 1103e0b
v: v3
  • Loading branch information
Jason Wang authored and David S. Miller committed Mar 26, 2013
1 parent b142bc9 commit fcfc42e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a88b9ce5ad4fc633b159b37d3ed8af60a4008fbc
refs/heads/master: 9b4d669bc06c215d64f56f1eb0d4eb96e14d689d
9 changes: 9 additions & 0 deletions trunk/drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <net/rtnetlink.h>
#include <net/sock.h>
#include <linux/virtio_net.h>
#include <net/flow_keys.h>

/*
* A macvtap queue is the central object of this driver, it connects
Expand Down Expand Up @@ -645,6 +646,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
int vnet_hdr_len = 0;
int copylen = 0;
bool zerocopy = false;
struct flow_keys keys;

if (q->flags & IFF_VNET_HDR) {
vnet_hdr_len = q->vnet_hdr_sz;
Expand Down Expand Up @@ -725,6 +727,13 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
goto err_kfree;
}

if (skb->ip_summed == CHECKSUM_PARTIAL)
skb_set_transport_header(skb, skb_checksum_start_offset(skb));
else if (skb_flow_dissect(skb, &keys))
skb_set_transport_header(skb, keys.thoff);
else
skb_set_transport_header(skb, ETH_HLEN);

rcu_read_lock_bh();
vlan = rcu_dereference_bh(q->vlan);
/* copy skb_ubuf_info for callback when skb has no error */
Expand Down

0 comments on commit fcfc42e

Please sign in to comment.