Tweak linux(4) socket(2) debug messages.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26900
This commit is contained in:
Edward Tomasz Napierala 2020-10-24 14:25:38 +00:00
parent 62b1382ff3
commit b3be0b4d0c
2 changed files with 18 additions and 0 deletions

View File

@ -58,6 +58,10 @@ struct l_sockaddr {
#define LINUX_AF_IPX 4
#define LINUX_AF_APPLETALK 5
#define LINUX_AF_INET6 10
#define LINUX_AF_NETLINK 16
#define LINUX_NETLINK_ROUTE 0
#define LINUX_NETLINK_UEVENT 15
/*
* net device flags

View File

@ -514,6 +514,20 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
return (retval_socket);
domain = linux_to_bsd_domain(args->domain);
if (domain == -1) {
if (args->domain == LINUX_AF_NETLINK &&
args->protocol == LINUX_NETLINK_ROUTE) {
linux_msg(curthread,
"unsupported socket(AF_NETLINK, %d, NETLINK_ROUTE)", type);
return (EAFNOSUPPORT);
}
if (args->domain == LINUX_AF_NETLINK &&
args->protocol == LINUX_NETLINK_UEVENT) {
linux_msg(curthread,
"unsupported socket(AF_NETLINK, %d, NETLINK_UEVENT)", type);
return (EAFNOSUPPORT);
}
linux_msg(curthread, "unsupported socket domain %d, type %d, protocol %d",
args->domain, args->type & LINUX_SOCK_TYPE_MASK, args->protocol);
return (EAFNOSUPPORT);