From f04150bca8c18c38f8cdd8cc5e33b058eab61b37 Mon Sep 17 00:00:00 2001 From: dchagin Date: Sat, 2 May 2009 10:51:40 +0000 Subject: Linux socketpair() call expects explicit specified protocol for AF_LOCAL domain unlike FreeBSD which expects 0 in this case. Approved by: kib (mentor) MFC after: 1 month --- sys/compat/linux/linux_socket.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/compat/linux/linux_socket.c') diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 56cc92e..c92fd12 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -859,7 +859,10 @@ linux_socketpair(struct thread *td, struct linux_socketpair_args *args) return (EINVAL); bsd_args.type = args->type; - bsd_args.protocol = args->protocol; + if (bsd_args.domain == AF_LOCAL && args->protocol == PF_UNIX) + bsd_args.protocol = 0; + else + bsd_args.protocol = args->protocol; bsd_args.rsv = (int *)PTRIN(args->rsv); return (socketpair(td, &bsd_args)); } -- cgit v1.1