aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Chen <zhangchen.fnst@cn.fujitsu.com>2017-07-04 14:53:53 +0800
committerJason Wang <jasowang@redhat.com>2017-07-17 20:13:51 +0800
commit5cc444d367078e3582b8e7e0136c53d3632c544b (patch)
treeb5f3d77f389a0fa5d1f4d06e60028f6a7f2f9d6f
parentaa3a7032f73f603818ea3e781b19ce8eab0d33f1 (diff)
downloadqemu-5cc444d367078e3582b8e7e0136c53d3632c544b.zip
qemu-5cc444d367078e3582b8e7e0136c53d3632c544b.tar.gz
qemu-5cc444d367078e3582b8e7e0136c53d3632c544b.tar.bz2
net/colo.c: Add vnet packet parse feature in colo-proxy
Make colo-compare and filter-rewriter can parse vnet packet. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
-rw-r--r--net/colo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/colo.c b/net/colo.c
index 180eaed..28ce7c8 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -43,11 +43,11 @@ int parse_packet_early(Packet *pkt)
{
int network_length;
static const uint8_t vlan[] = {0x81, 0x00};
- uint8_t *data = pkt->data;
+ uint8_t *data = pkt->data + pkt->vnet_hdr_len;
uint16_t l3_proto;
ssize_t l2hdr_len = eth_get_l2_hdr_length(data);
- if (pkt->size < ETH_HLEN) {
+ if (pkt->size < ETH_HLEN + pkt->vnet_hdr_len) {
trace_colo_proxy_main("pkt->size < ETH_HLEN");
return 1;
}
@@ -73,7 +73,7 @@ int parse_packet_early(Packet *pkt)
}
network_length = pkt->ip->ip_hl * 4;
- if (pkt->size < l2hdr_len + network_length) {
+ if (pkt->size < l2hdr_len + network_length + pkt->vnet_hdr_len) {
trace_colo_proxy_main("pkt->size < network_header + network_length");
return 1;
}