svn commit: r220186 - in head/sys: amd64/linux32 compat/linux i386/linux

Andriy Gapon avg at FreeBSD.org
Thu Mar 31 08:14:52 UTC 2011


Author: avg
Date: Thu Mar 31 08:14:51 2011
New Revision: 220186
URL: http://svn.freebsd.org/changeset/base/220186

Log:
  Revert r220032:linux compat: add SO_PASSCRED option with basic handling
  
  I have not properly thought through the commit.  After r220031 (linux
  compat: improve and fix sendmsg/recvmsg compatibility) the basic
  handling for SO_PASSCRED is not sufficient as it breaks recvmsg
  functionality for SCM_CREDS messages because now we would need to handle
  sockcred data in addition to cmsgcred.  And that is not implemented yet.
  
  Pointyhat to:	avg

Modified:
  head/sys/amd64/linux32/linux.h
  head/sys/compat/linux/linux_socket.c
  head/sys/i386/linux/linux.h

Modified: head/sys/amd64/linux32/linux.h
==============================================================================
--- head/sys/amd64/linux32/linux.h	Thu Mar 31 08:07:13 2011	(r220185)
+++ head/sys/amd64/linux32/linux.h	Thu Mar 31 08:14:51 2011	(r220186)
@@ -695,7 +695,6 @@ union l_semun {
 #define	LINUX_SO_NO_CHECK	11
 #define	LINUX_SO_PRIORITY	12
 #define	LINUX_SO_LINGER		13
-#define	LINUX_SO_PASSCRED	16
 #define	LINUX_SO_PEERCRED	17
 #define	LINUX_SO_RCVLOWAT	18
 #define	LINUX_SO_SNDLOWAT	19

Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c	Thu Mar 31 08:07:13 2011	(r220185)
+++ head/sys/compat/linux/linux_socket.c	Thu Mar 31 08:14:51 2011	(r220186)
@@ -300,8 +300,6 @@ linux_to_bsd_so_sockopt(int opt)
 		return (SO_OOBINLINE);
 	case LINUX_SO_LINGER:
 		return (SO_LINGER);
-	case LINUX_SO_PASSCRED:
-		return (LOCAL_CREDS);
 	case LINUX_SO_PEERCRED:
 		return (LOCAL_PEERCRED);
 	case LINUX_SO_RCVLOWAT:
@@ -1469,12 +1467,6 @@ linux_setsockopt(struct thread *td, stru
 	switch (bsd_args.level) {
 	case SOL_SOCKET:
 		name = linux_to_bsd_so_sockopt(args->optname);
-		switch (args->optname) {
-		case LINUX_SO_PASSCRED:
-			/* FreeBSD bug? socket level opts at non socket level */
-			bsd_args.level = 0;
-			break;
-		}
 		switch (name) {
 		case SO_RCVTIMEO:
 			/* FALLTHROUGH */
@@ -1552,12 +1544,6 @@ linux_getsockopt(struct thread *td, stru
 	switch (bsd_args.level) {
 	case SOL_SOCKET:
 		name = linux_to_bsd_so_sockopt(args->optname);
-		switch (args->optname) {
-		case LINUX_SO_PASSCRED:
-			/* FreeBSD bug? socket level opts at non socket level */
-			bsd_args.level = 0;
-			break;
-		}
 		switch (name) {
 		case SO_RCVTIMEO:
 			/* FALLTHROUGH */

Modified: head/sys/i386/linux/linux.h
==============================================================================
--- head/sys/i386/linux/linux.h	Thu Mar 31 08:07:13 2011	(r220185)
+++ head/sys/i386/linux/linux.h	Thu Mar 31 08:14:51 2011	(r220186)
@@ -671,7 +671,6 @@ union l_semun {
 #define	LINUX_SO_NO_CHECK	11
 #define	LINUX_SO_PRIORITY	12
 #define	LINUX_SO_LINGER		13
-#define	LINUX_SO_PASSCRED	16
 #define	LINUX_SO_PEERCRED	17
 #define	LINUX_SO_RCVLOWAT	18
 #define	LINUX_SO_SNDLOWAT	19


More information about the svn-src-all mailing list