Skip to content

Commit 47ee43e

Browse files
stefano-garzarellakuba-moo
authored andcommitted
vsock/test: fix vsock_ioctl_int() check for unsupported ioctl
`vsock_do_ioctl` returns -ENOIOCTLCMD if an ioctl support is not implemented, like for SIOCINQ before commit f7c7226 ("vsock: Add support for SIOCINQ ioctl"). In net/socket.c, -ENOIOCTLCMD is re-mapped to -ENOTTY for the user space. So, our test suite, without that commit applied, is failing in this way: 34 - SOCK_STREAM ioctl(SIOCINQ) functionality...ioctl(21531): Inappropriate ioctl for device Return false in vsock_ioctl_int() to skip the test in this case as well, instead of failing. Fixes: 53548d6 ("test/vsock: Add retry mechanism to ioctl wrapper") Cc: [email protected] Signed-off-by: Stefano Garzarella <[email protected]> Reviewed-by: Xuewei Niu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7eeabfb commit 47ee43e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/vsock/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bool vsock_ioctl_int(int fd, unsigned long op, int expected)
116116
do {
117117
ret = ioctl(fd, op, &actual);
118118
if (ret < 0) {
119-
if (errno == EOPNOTSUPP)
119+
if (errno == EOPNOTSUPP || errno == ENOTTY)
120120
break;
121121

122122
perror(name);

0 commit comments

Comments
 (0)