diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-08 15:40:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-08 15:40:42 +0200 |
commit | 8aff4eaa1de7a0ba70af8447ed08127ef0e8e45d (patch) | |
tree | 8fff0fab5c3ac5ba1774ce1706e8ec4f50ad0377 /net/packet/af_packet.c | |
parent | e7a2c3fa28576684d744e259a2fdb245f8bab0d7 (diff) | |
parent | 0238df646e6224016a45505d2c111a24669ebe21 (diff) | |
download | lwn-8aff4eaa1de7a0ba70af8447ed08127ef0e8e45d.tar.gz lwn-8aff4eaa1de7a0ba70af8447ed08127ef0e8e45d.zip |
Merge 4.19-rc7 into usb-next
We want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/packet/af_packet.c')
-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 75c92a87e7b2..d6e94dc7e290 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); |