Add this tag that compare can recognize virtio-net packet. Signed-off-by: Zhang Chen <zhangchen.f...@cn.fujitsu.com> --- net/colo.c | 6 ++++++ net/colo.h | 2 ++ 2 files changed, 8 insertions(+)
diff --git a/net/colo.c b/net/colo.c index 060e822..d2b3683 100644 --- a/net/colo.c +++ b/net/colo.c @@ -79,6 +79,12 @@ int parse_packet_early(Packet *pkt, int offset) } pkt->transport_header = pkt->network_header + network_length; + if (offset == VIRTIO_NET_HEADER) { + pkt->is_virtio_net_pkt = true; + } else { + pkt->is_virtio_net_pkt = false; + } + return 0; } diff --git a/net/colo.h b/net/colo.h index b713f87..535793d 100644 --- a/net/colo.h +++ b/net/colo.h @@ -46,6 +46,8 @@ typedef struct Packet { int size; /* Time of packet creation, in wall clock ms */ int64_t creation_ms; + /* Mark this packet as a virtio net packet or not */ + bool is_virtio_net_pkt; } Packet; typedef struct ConnectionKey { -- 2.7.4