|
@@ -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);
|