Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 May 2009 10:51:40 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r191742 - head/sys/compat/linux
Message-ID:  <200905021051.n42ApetI083033@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905021051.n42ApetI083033>