#include "net/filter.h"
#include "net/net.h"
#include "qemu-common.h"
-#include "qapi/error.h"
-#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
-#include "qapi-visit.h"
#include "qom/object.h"
#include "qemu/main-loop.h"
#include "qemu/iov.h"
struct tcphdr *tcp_pkt;
tcp_pkt = (struct tcphdr *)pkt->transport_header;
- if (trace_event_get_state(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
+ if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
trace_colo_filter_rewriter_pkt_info(__func__,
inet_ntoa(pkt->ip->ip_src), inet_ntoa(pkt->ip->ip_dst),
ntohl(tcp_pkt->th_seq), ntohl(tcp_pkt->th_ack),
/* handle packets to the secondary from the primary */
tcp_pkt->th_ack = htonl(ntohl(tcp_pkt->th_ack) + conn->offset);
- net_checksum_calculate((uint8_t *)pkt->data, pkt->size);
+ net_checksum_calculate((uint8_t *)pkt->data + pkt->vnet_hdr_len,
+ pkt->size - pkt->vnet_hdr_len);
}
}
tcp_pkt = (struct tcphdr *)pkt->transport_header;
- if (trace_event_get_state(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
+ if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
trace_colo_filter_rewriter_pkt_info(__func__,
inet_ntoa(pkt->ip->ip_src), inet_ntoa(pkt->ip->ip_dst),
ntohl(tcp_pkt->th_seq), ntohl(tcp_pkt->th_ack),
/* handle packets to the primary from the secondary*/
tcp_pkt->th_seq = htonl(ntohl(tcp_pkt->th_seq) - conn->offset);
- net_checksum_calculate((uint8_t *)pkt->data, pkt->size);
+ net_checksum_calculate((uint8_t *)pkt->data + pkt->vnet_hdr_len,
+ pkt->size - pkt->vnet_hdr_len);
}
}