svn commit: r191742 - head/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Sat May 2 10:51:42 UTC 2009


Author: dchagin
Date: Sat May  2 10:51:40 2009
New Revision: 191742
URL: http://svn.freebsd.org/changeset/base/191742

Log:
  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

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c	Sat May  2 10:06:49 2009	(r191741)
+++ head/sys/compat/linux/linux_socket.c	Sat May  2 10:51:40 2009	(r191742)
@@ -859,7 +859,10 @@ linux_socketpair(struct thread *td, stru
 		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));
 }


More information about the svn-src-head mailing list