summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-14 15:44:40 -0600
committerJens Axboe <axboe@kernel.dk>2022-05-14 15:44:40 -0600
commita886f04557c676270152660816eeba1f3d54560b (patch)
treea49bbee5e2e51e3e0b70686e15907440814e3e3e
parent5d52bb71eeecb92134bd4cea42c280a08f5714c7 (diff)
downloadliburing-a886f04557c676270152660816eeba1f3d54560b.tar.gz
liburing-a886f04557c676270152660816eeba1f3d54560b.tar.bz2
test/send_recvmsg.c: only check buffer group ID if set
This test assumes that the only valid flag being set for a send/recv is IORING_CQE_F_BUFFER. But that isn't necessarily true, so check specifically for whether this is a provided buffer return before checking the buffer group ID. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/send_recvmsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/send_recvmsg.c b/test/send_recvmsg.c
index f607b5c..2d9315b 100644
--- a/test/send_recvmsg.c
+++ b/test/send_recvmsg.c
@@ -112,7 +112,7 @@ static int do_recvmsg(struct io_uring *ring, char buf[MAX_MSG + 1],
fprintf(stderr, "%s: failed cqe: %d\n", __FUNCTION__, cqe->res);
goto err;
}
- if (cqe->flags) {
+ if (cqe->flags & IORING_CQE_F_BUFFER) {
int bid = cqe->flags >> 16;
if (bid != BUF_BID)
fprintf(stderr, "Buffer ID mismatch %d\n", bid);