mirror of
https://git.proxmox.com/git/qemu
synced 2025-07-09 20:23:01 +00:00
virtio-net: minor code simplification
During packet filtering, we can now use host hdr len to offset incoming buffer unconditionally. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
7b80d08efc
commit
e043ebc6f9
@ -544,9 +544,7 @@ static int receive_filter(VirtIONet *n, const uint8_t *buf, int size)
|
|||||||
if (n->promisc)
|
if (n->promisc)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (n->has_vnet_hdr) {
|
ptr += n->host_hdr_len;
|
||||||
ptr += sizeof(struct virtio_net_hdr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!memcmp(&ptr[12], vlan, sizeof(vlan))) {
|
if (!memcmp(&ptr[12], vlan, sizeof(vlan))) {
|
||||||
int vid = be16_to_cpup((uint16_t *)(ptr + 14)) & 0xfff;
|
int vid = be16_to_cpup((uint16_t *)(ptr + 14)) & 0xfff;
|
||||||
|
Loading…
Reference in New Issue
Block a user