Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143451
b: refs/heads/master
c: 0eca93b
h: refs/heads/master
i:
  143449: 4526c10
  143447: 845b186
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Apr 14, 2009
1 parent 97113ce commit f66e7ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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: 86bcebafc5e7f5163ccf828792fe694b112ed6fa
refs/heads/master: 0eca93bcf73e5939053a94f7c48f8d6fe6199e00
5 changes: 3 additions & 2 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
int err;

/* Under a page? Don't bother with paged skb. */
if (prepad + len < PAGE_SIZE)
if (prepad + len < PAGE_SIZE || !linear)
linear = len;

skb = sock_alloc_send_pskb(sk, prepad + linear, len - linear, noblock,
Expand Down Expand Up @@ -565,7 +565,8 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun,

if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
align = NET_IP_ALIGN;
if (unlikely(len < ETH_HLEN))
if (unlikely(len < ETH_HLEN ||
(gso.hdr_len && gso.hdr_len < ETH_HLEN)))
return -EINVAL;
}

Expand Down

0 comments on commit f66e7ac

Please sign in to comment.