aboutgitcodebugslistschat
path: root/tap.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2024-03-07 12:26:02 +0100
committerStefano Brivio <sbrivio@redhat.com>2024-03-13 14:37:27 +0100
commitb299942bbde8770c5fbe4f66c932b1d2ac05ab8f (patch)
tree8f290fdb9ba54bd769b8584e0c811f7eba187865 /tap.c
parent413c15988ea381fbafa4eedbf821fe51f6d1651a (diff)
downloadpasst-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.tar
passt-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.tar.gz
passt-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.tar.bz2
passt-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.tar.lz
passt-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.tar.xz
passt-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.tar.zst
passt-b299942bbde8770c5fbe4f66c932b1d2ac05ab8f.zip
tap: Capture only packets that are actually sent
In tap_send_frames(), if we failed to send all the frames, we must only log the frames that have been sent, not all the frames we wanted to send. Fixes: dda7945ca9c9 ("pcap: Handle short writes in pcap_frame()") Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tap.c')
-rw-r--r--tap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tap.c b/tap.c
index c7b9372..f4051ce 100644
--- a/tap.c
+++ b/tap.c
@@ -413,7 +413,7 @@ size_t tap_send_frames(const struct ctx *c, const struct iovec *iov, size_t n)
if (m < n)
debug("tap: failed to send %zu frames of %zu", n - m, n);
- pcap_multiple(iov, 1, n, c->mode == MODE_PASST ? sizeof(uint32_t) : 0);
+ pcap_multiple(iov, 1, m, c->mode == MODE_PASST ? sizeof(uint32_t) : 0);
return m;
}