diff options
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 1f21d2a1e528..5c170100de9c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/if_arp.h> | 24 | #include <linux/if_arp.h> |
25 | #include <linux/if_tun.h> | 25 | #include <linux/if_tun.h> |
26 | #include <linux/if_macvlan.h> | 26 | #include <linux/if_macvlan.h> |
27 | #include <linux/if_vlan.h> | ||
27 | 28 | ||
28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
29 | 30 | ||
@@ -283,8 +284,12 @@ static int peek_head_len(struct sock *sk) | |||
283 | 284 | ||
284 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); | 285 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); |
285 | head = skb_peek(&sk->sk_receive_queue); | 286 | head = skb_peek(&sk->sk_receive_queue); |
286 | if (likely(head)) | 287 | if (likely(head)) { |
287 | len = head->len; | 288 | len = head->len; |
289 | if (vlan_tx_tag_present(head)) | ||
290 | len += VLAN_HLEN; | ||
291 | } | ||
292 | |||
288 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); | 293 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); |
289 | return len; | 294 | return len; |
290 | } | 295 | } |