@@ -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;
}
@@ -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 {
Add this tag that compare can recognize virtio-net packet. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> --- net/colo.c | 6 ++++++ net/colo.h | 2 ++ 2 files changed, 8 insertions(+)