Make linuxulator warn about unsupported getsockopt/setsockopt flags.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D23791
This commit is contained in:
Edward Tomasz Napierala 2020-02-27 19:40:20 +00:00
parent 28180b6298
commit 5d481ad8df

View File

@ -1451,9 +1451,12 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args)
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;
@ -1546,8 +1549,12 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args)
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));