Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368694
b: refs/heads/master
c: 38502af
h: refs/heads/master
v: v3
  • Loading branch information
Jason Wang authored and David S. Miller committed Mar 26, 2013
1 parent fcfc42e commit b3369b1
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 9b4d669bc06c215d64f56f1eb0d4eb96e14d689d
refs/heads/master: 38502af77e07b5d6650b9ff99a0b482d86366592
10 changes: 10 additions & 0 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include <net/sock.h>

#include <asm/uaccess.h>
#include <net/flow_keys.h>

/* Uncomment to enable debugging */
/* #define TUN_DEBUG 1 */
Expand Down Expand Up @@ -1049,6 +1050,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
bool zerocopy = false;
int err;
u32 rxhash;
struct flow_keys keys;

if (!(tun->flags & TUN_NO_PI)) {
if ((len -= sizeof(pi)) > total_len)
Expand Down Expand Up @@ -1203,6 +1205,14 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
}

skb_reset_network_header(skb);

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_reset_transport_header(skb);

rxhash = skb_get_rxhash(skb);
netif_rx_ni(skb);

Expand Down

0 comments on commit b3369b1

Please sign in to comment.