tap: Send frames after the first one in tap_send_frames_pasta()

...instead of repeatedly sending out the first one in iov.

Fixes: e21ee41ac3 ("tcp: Combine two parts of pasta tap send path together")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2023-02-12 14:34:38 +01:00
parent d8921dafe5
commit ac153595c0

3
tap.c
View file

@ -316,12 +316,13 @@ static void tap_send_frames_pasta(struct ctx *c,
{ {
size_t i; size_t i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++, iov++) {
if (write(c->fd_tap, (char *)iov->iov_base, iov->iov_len) < 0) { if (write(c->fd_tap, (char *)iov->iov_base, iov->iov_len) < 0) {
debug("tap write: %s", strerror(errno)); debug("tap write: %s", strerror(errno));
if (errno != EAGAIN && errno != EWOULDBLOCK) if (errno != EAGAIN && errno != EWOULDBLOCK)
tap_handler(c, c->fd_tap, EPOLLERR, NULL); tap_handler(c, c->fd_tap, EPOLLERR, NULL);
i--; i--;
iov--;
} }
} }
} }