svn commit: r358403 - head/sys/compat/linux
Edward Tomasz Napierala
trasz at FreeBSD.org
Thu Feb 27 19:40:23 UTC 2020
Author: trasz
Date: Thu Feb 27 19:40:20 2020
New Revision: 358403
URL: https://svnweb.freebsd.org/changeset/base/358403
Log:
Make linuxulator warn about unsupported getsockopt/setsockopt flags.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23791
Modified:
head/sys/compat/linux/linux_socket.c
Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c Thu Feb 27 19:35:17 2020 (r358402)
+++ head/sys/compat/linux/linux_socket.c Thu Feb 27 19:40:20 2020 (r358403)
@@ -1451,10 +1451,13 @@ linux_setsockopt(struct thread *td, struct linux_setso
name = -1;
break;
}
- if (name == -1)
+ if (name == -1) {
+ linux_msg(curthread,
+ "unsupported setsockopt level %d optname %d",
+ args->level, args->optname);
return (ENOPROTOOPT);
+ }
-
if (name == IPV6_NEXTHOP) {
len = args->optlen;
error = linux_to_bsd_sockaddr(PTRIN(args->optval), &sa, &len);
@@ -1546,8 +1549,12 @@ linux_getsockopt(struct thread *td, struct linux_getso
name = -1;
break;
}
- if (name == -1)
+ if (name == -1) {
+ linux_msg(curthread,
+ "unsupported getsockopt level %d optname %d",
+ args->level, args->optname);
return (EINVAL);
+ }
if (name == IPV6_NEXTHOP) {
error = copyin(PTRIN(args->optlen), &len, sizeof(len));
More information about the svn-src-all
mailing list