[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 5/6] net/colo.c: Add vnet packet parse feature in
From: |
Zhang Chen |
Subject: |
[Qemu-devel] [PATCH V2 5/6] net/colo.c: Add vnet packet parse feature in colo-proxy |
Date: |
Thu, 20 Apr 2017 14:39:05 +0800 |
Make colo-compare and filter-rewriter can parse vnet packet.
Signed-off-by: Zhang Chen <address@hidden>
---
net/colo.c | 6 +++---
1 file 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;
}
--
2.7.4
- [Qemu-devel] [PATCH V2 0/6] Add COLO-proxy virtio-net support, Zhang Chen, 2017/04/20
- [Qemu-devel] [PATCH V2 2/6] net/net.c: Add vnet header length to SocketReadState, Zhang Chen, 2017/04/20
- [Qemu-devel] [PATCH V2 1/6] net/filter-mirror.c: Add filter-mirror and filter-redirector vnet support., Zhang Chen, 2017/04/20
- [Qemu-devel] [PATCH V2 3/6] net/colo-compare.c: Make colo-compare support vnet_hdr_len, Zhang Chen, 2017/04/20
- [Qemu-devel] [PATCH V2 4/6] net/socket.c: Add vnet packet support in net_socket_receive(), Zhang Chen, 2017/04/20
- [Qemu-devel] [PATCH V2 5/6] net/colo.c: Add vnet packet parse feature in colo-proxy,
Zhang Chen <=
- [Qemu-devel] [PATCH V2 6/6] net/colo-compare.c: Add vnet packet's tcp/udp/icmp compare, Zhang Chen, 2017/04/20
- Re: [Qemu-devel] [PATCH V2 0/6] Add COLO-proxy virtio-net support, Jason Wang, 2017/04/23