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
This commit is contained in:
Dmitry Chagin 2009-05-02 10:51:40 +00:00
parent d789bfd562
commit 40092d93b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191742

View file

@ -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));
}