Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98236
b: refs/heads/master
c: f09f7ee
h: refs/heads/master
v: v3
  • Loading branch information
Ang Way Chuang authored and David S. Miller committed Jun 18, 2008
1 parent 1a101a0 commit e6a2161
Show file tree
Hide file tree
Showing 2 changed files with 16 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: fe833fca2eac6b3d3ad5e35f44ad4638362f1da8
refs/heads/master: f09f7ee20c867818bacf79426cf491b2749e7eff
15 changes: 15 additions & 0 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,21 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,

switch (tun->flags & TUN_TYPE_MASK) {
case TUN_TUN_DEV:
if (tun->flags & TUN_NO_PI) {
switch (skb->data[0] & 0xf0) {
case 0x40:
pi.proto = htons(ETH_P_IP);
break;
case 0x60:
pi.proto = htons(ETH_P_IPV6);
break;
default:
tun->dev->stats.rx_dropped++;
kfree_skb(skb);
return -EINVAL;
}
}

skb_reset_mac_header(skb);
skb->protocol = pi.proto;
skb->dev = tun->dev;
Expand Down

0 comments on commit e6a2161

Please sign in to comment.