aboutsummaryrefslogtreecommitdiff
path: root/hw/net/vmxnet3.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-07-07 15:48:49 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-07-07 15:48:49 +0100
commitf2562fbb7ac54d597cfe05f613d30296d1850d1b (patch)
tree56188fa8a999e5c40faf14ebe9fb82b194109f44 /hw/net/vmxnet3.c
parentaeb72188e073d515e1f5a80f6b603692a396477b (diff)
parent849729bb796e0ecbb3f370f119682f2821dd1441 (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging
# gpg: Signature made Tue Jul 7 13:38:13 2015 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/net-pull-request: rocker: tests: don't need to specify master/self when setting vlans rocker: mark copy-to-cpu pkts as forwarding offloaded rocker: return -1 when dropping packet on ingress rocker: fix missing break statements rocker: fix misplaced break statement rocker: don't queue receive pkts when port is disabled vmxnet3: Fix incorrect small packet padding e1000: flush packets when link comes up rocker: fix memory leak Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/net/vmxnet3.c')
-rw-r--r--hw/net/vmxnet3.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 104a0f599b..706e0606a9 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1879,6 +1879,12 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *buf, size_t size)
return -1;
}
+ if (s->peer_has_vhdr) {
+ vmxnet_rx_pkt_set_vhdr(s->rx_pkt, (struct virtio_net_hdr *)buf);
+ buf += sizeof(struct virtio_net_hdr);
+ size -= sizeof(struct virtio_net_hdr);
+ }
+
/* Pad to minimum Ethernet frame length */
if (size < sizeof(min_buf)) {
memcpy(min_buf, buf, size);
@@ -1887,12 +1893,6 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *buf, size_t size)
size = sizeof(min_buf);
}
- if (s->peer_has_vhdr) {
- vmxnet_rx_pkt_set_vhdr(s->rx_pkt, (struct virtio_net_hdr *)buf);
- buf += sizeof(struct virtio_net_hdr);
- size -= sizeof(struct virtio_net_hdr);
- }
-
vmxnet_rx_pkt_set_packet_type(s->rx_pkt,
get_eth_packet_type(PKT_GET_ETH_HDR(buf)));