diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-06 23:43:42 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-06 23:43:42 +0200 |
commit | 72438f8cef4e75a22140853baa4c68392c721b22 (patch) | |
tree | 78b7b6dafd827e0d55150a227db3978d91c0b6dd /net/packet | |
parent | net/ncsi: Add NCSI OEM command support (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff) | |
download | linux-72438f8cef4e75a22140853baa4c68392c721b22.tar.xz linux-72438f8cef4e75a22140853baa4c68392c721b22.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index f85f67b5c1f4..ec3095f13aae 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -2715,10 +2715,12 @@ tpacket_error: } } - if (po->has_vnet_hdr && virtio_net_hdr_to_skb(skb, vnet_hdr, - vio_le())) { - tp_len = -EINVAL; - goto tpacket_error; + if (po->has_vnet_hdr) { + if (virtio_net_hdr_to_skb(skb, vnet_hdr, vio_le())) { + tp_len = -EINVAL; + goto tpacket_error; + } + virtio_net_hdr_set_proto(skb, vnet_hdr); } skb->destructor = tpacket_destruct_skb; @@ -2915,6 +2917,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) if (err) goto out_free; len += sizeof(vnet_hdr); + virtio_net_hdr_set_proto(skb, &vnet_hdr); } skb_probe_transport_header(skb, reserve); |