diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tun.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 8a27cbf19dd6..17db19420637 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -584,7 +584,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, | |||
584 | { | 584 | { |
585 | struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) }; | 585 | struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) }; |
586 | struct sk_buff *skb; | 586 | struct sk_buff *skb; |
587 | size_t len = count, align = 0; | 587 | size_t len = count, align = NET_SKB_PAD; |
588 | struct virtio_net_hdr gso = { 0 }; | 588 | struct virtio_net_hdr gso = { 0 }; |
589 | int offset = 0; | 589 | int offset = 0; |
590 | 590 | ||
@@ -614,7 +614,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, | |||
614 | } | 614 | } |
615 | 615 | ||
616 | if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) { | 616 | if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) { |
617 | align = NET_IP_ALIGN; | 617 | align += NET_IP_ALIGN; |
618 | if (unlikely(len < ETH_HLEN || | 618 | if (unlikely(len < ETH_HLEN || |
619 | (gso.hdr_len && gso.hdr_len < ETH_HLEN))) | 619 | (gso.hdr_len && gso.hdr_len < ETH_HLEN))) |
620 | return -EINVAL; | 620 | return -EINVAL; |