Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2017 18:23:30 +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: r315501 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux
Message-ID:  <201703181823.v2IINU7d070531@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Mar 18 18:23:30 2017
New Revision: 315501
URL: https://svnweb.freebsd.org/changeset/base/315501

Log:
  To reduce code duplication move socket defines to the MI path.
  
  MFC after:	1 week

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

Modified: head/sys/amd64/linux/linux.h
==============================================================================
--- head/sys/amd64/linux/linux.h	Sat Mar 18 18:21:41 2017	(r315500)
+++ head/sys/amd64/linux/linux.h	Sat Mar 18 18:23:30 2017	(r315501)
@@ -383,50 +383,6 @@ union l_semun {
 	l_uintptr_t	__pad;
 };
 
-/*
- * Socket defines
- */
-
-#define	LINUX_SOL_SOCKET	1
-#define	LINUX_SOL_IP		0
-#define	LINUX_SOL_IPX		256
-#define	LINUX_SOL_AX25		257
-#define	LINUX_SOL_TCP		6
-#define	LINUX_SOL_UDP		17
-
-#define	LINUX_SO_DEBUG		1
-#define	LINUX_SO_REUSEADDR	2
-#define	LINUX_SO_TYPE		3
-#define	LINUX_SO_ERROR		4
-#define	LINUX_SO_DONTROUTE	5
-#define	LINUX_SO_BROADCAST	6
-#define	LINUX_SO_SNDBUF		7
-#define	LINUX_SO_RCVBUF		8
-#define	LINUX_SO_KEEPALIVE	9
-#define	LINUX_SO_OOBINLINE	10
-#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
-#define	LINUX_SO_RCVTIMEO	20
-#define	LINUX_SO_SNDTIMEO	21
-#define	LINUX_SO_TIMESTAMP	29
-#define	LINUX_SO_ACCEPTCONN	30
-
-#define	LINUX_IP_TOS		1
-#define	LINUX_IP_TTL		2
-#define	LINUX_IP_HDRINCL	3
-#define	LINUX_IP_OPTIONS	4
-
-#define	LINUX_IP_MULTICAST_IF		32
-#define	LINUX_IP_MULTICAST_TTL		33
-#define	LINUX_IP_MULTICAST_LOOP		34
-#define	LINUX_IP_ADD_MEMBERSHIP		35
-#define	LINUX_IP_DROP_MEMBERSHIP	36
-
 struct l_sockaddr {
 	l_ushort	sa_family;
 	char		sa_data[14];

Modified: head/sys/amd64/linux32/linux.h
==============================================================================
--- head/sys/amd64/linux32/linux.h	Sat Mar 18 18:21:41 2017	(r315500)
+++ head/sys/amd64/linux32/linux.h	Sat Mar 18 18:23:30 2017	(r315501)
@@ -474,37 +474,6 @@ union l_semun {
 	l_uintptr_t	__pad;
 } __packed;
 
-/*
- * Socket defines
- */
-#define	LINUX_SOL_SOCKET	1
-#define	LINUX_SOL_IP		0
-#define	LINUX_SOL_IPX		256
-#define	LINUX_SOL_AX25		257
-#define	LINUX_SOL_TCP		6
-#define	LINUX_SOL_UDP		17
-
-#define	LINUX_SO_DEBUG		1
-#define	LINUX_SO_REUSEADDR	2
-#define	LINUX_SO_TYPE		3
-#define	LINUX_SO_ERROR		4
-#define	LINUX_SO_DONTROUTE	5
-#define	LINUX_SO_BROADCAST	6
-#define	LINUX_SO_SNDBUF		7
-#define	LINUX_SO_RCVBUF		8
-#define	LINUX_SO_KEEPALIVE	9
-#define	LINUX_SO_OOBINLINE	10
-#define	LINUX_SO_NO_CHECK	11
-#define	LINUX_SO_PRIORITY	12
-#define	LINUX_SO_LINGER		13
-#define	LINUX_SO_PEERCRED	17
-#define	LINUX_SO_RCVLOWAT	18
-#define	LINUX_SO_SNDLOWAT	19
-#define	LINUX_SO_RCVTIMEO	20
-#define	LINUX_SO_SNDTIMEO	21
-#define	LINUX_SO_TIMESTAMP	29
-#define	LINUX_SO_ACCEPTCONN	30
-
 struct l_sockaddr {
 	l_ushort	sa_family;
 	char		sa_data[14];

Modified: head/sys/compat/linux/linux_socket.h
==============================================================================
--- head/sys/compat/linux/linux_socket.h	Sat Mar 18 18:21:41 2017	(r315500)
+++ head/sys/compat/linux/linux_socket.h	Sat Mar 18 18:23:30 2017	(r315501)
@@ -172,6 +172,39 @@ int linux_accept(struct thread *td, stru
 #define	LINUX_SENDMMSG		20
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
+/* Socket defines */
+#define	LINUX_SOL_SOCKET	1
+#define	LINUX_SOL_IP		0
+#define	LINUX_SOL_TCP		6
+#define	LINUX_SOL_UDP		17
+#define	LINUX_SOL_IPV6		41
+#define	LINUX_SOL_IPX		256
+#define	LINUX_SOL_AX25		257
+
+#define	LINUX_SO_DEBUG		1
+#define	LINUX_SO_REUSEADDR	2
+#define	LINUX_SO_TYPE		3
+#define	LINUX_SO_ERROR		4
+#define	LINUX_SO_DONTROUTE	5
+#define	LINUX_SO_BROADCAST	6
+#define	LINUX_SO_SNDBUF		7
+#define	LINUX_SO_RCVBUF		8
+#define	LINUX_SO_KEEPALIVE	9
+#define	LINUX_SO_OOBINLINE	10
+#define	LINUX_SO_NO_CHECK	11
+#define	LINUX_SO_PRIORITY	12
+#define	LINUX_SO_LINGER		13
+#ifndef LINUX_SO_PASSCRED	/* powerpc differs */
+#define	LINUX_SO_PASSCRED	16
+#define	LINUX_SO_PEERCRED	17
+#define	LINUX_SO_RCVLOWAT	18
+#define	LINUX_SO_SNDLOWAT	19
+#define	LINUX_SO_RCVTIMEO	20
+#define	LINUX_SO_SNDTIMEO	21
+#endif
+#define	LINUX_SO_TIMESTAMP	29
+#define	LINUX_SO_ACCEPTCONN	30
+
 /* Socket options */
 #define	LINUX_IP_TOS		1
 #define	LINUX_IP_TTL		2

Modified: head/sys/i386/linux/linux.h
==============================================================================
--- head/sys/i386/linux/linux.h	Sat Mar 18 18:21:41 2017	(r315500)
+++ head/sys/i386/linux/linux.h	Sat Mar 18 18:23:30 2017	(r315501)
@@ -453,37 +453,6 @@ union l_semun {
 	void		*__pad;
 };
 
-/*
- * Socket defines
- */
-#define	LINUX_SOL_SOCKET	1
-#define	LINUX_SOL_IP		0
-#define	LINUX_SOL_IPX		256
-#define	LINUX_SOL_AX25		257
-#define	LINUX_SOL_TCP		6
-#define	LINUX_SOL_UDP		17
-
-#define	LINUX_SO_DEBUG		1
-#define	LINUX_SO_REUSEADDR	2
-#define	LINUX_SO_TYPE		3
-#define	LINUX_SO_ERROR		4
-#define	LINUX_SO_DONTROUTE	5
-#define	LINUX_SO_BROADCAST	6
-#define	LINUX_SO_SNDBUF		7
-#define	LINUX_SO_RCVBUF		8
-#define	LINUX_SO_KEEPALIVE	9
-#define	LINUX_SO_OOBINLINE	10
-#define	LINUX_SO_NO_CHECK	11
-#define	LINUX_SO_PRIORITY	12
-#define	LINUX_SO_LINGER		13
-#define	LINUX_SO_PEERCRED	17
-#define	LINUX_SO_RCVLOWAT	18
-#define	LINUX_SO_SNDLOWAT	19
-#define	LINUX_SO_RCVTIMEO	20
-#define	LINUX_SO_SNDTIMEO	21
-#define	LINUX_SO_TIMESTAMP	29
-#define	LINUX_SO_ACCEPTCONN	30
-
 struct l_sockaddr {
 	l_ushort	sa_family;
 	char		sa_data[14];



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