aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-08 14:17:53 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-10 16:51:33 +0100
commitf0776eac07cfae76a51b5f55d5f95c8a5c62640f (patch)
tree7ada3f0f0a27687b6c8f4893ed480dd97e5cc618
parentcf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae (diff)
downloadpasst-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.tar
passt-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.tar.gz
passt-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.tar.bz2
passt-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.tar.lz
passt-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.tar.xz
passt-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.tar.zst
passt-f0776eac07cfae76a51b5f55d5f95c8a5c62640f.zip
tap, pasta: Handle incomplete tap sends for pasta too
Since a469fc39 ("tcp, tap: Don't increase tap-side sequence counter for dropped frames") we've handled more gracefully the case where we get data from the socket side, but are temporarily unable to send it all to the tap side (e.g. due to full buffers). That code relies on tap_send_frames() returning the number of frames it successfully sent, which in turn gets it from tap_send_frames_passt() or tap_send_frames_pasta(). While tap_send_frames_passt() has returned that information since b62ed9ca ("tap: Don't pcap frames that didn't get sent"), tap_send_frames_pasta() always returns as though it succesfully sent every frame. However there certainly are cases where it will return early without sending all frames. Update it report that properly, so that the calling functions can handle it properly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--tap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tap.c b/tap.c
index 3a938f3..00622e7 100644
--- a/tap.c
+++ b/tap.c
@@ -330,8 +330,6 @@ static size_t tap_send_frames_pasta(const struct ctx *c,
case EWOULDBLOCK:
#endif
case EINTR:
- i--;
- break;
case ENOBUFS:
case ENOSPC:
break;
@@ -341,7 +339,7 @@ static size_t tap_send_frames_pasta(const struct ctx *c,
}
}
- return n;
+ return i;
}
/**