changeset 13067:5b1463e9bb94

PSARC/2010/304 Deliver Socket Configuration in Fragments 6923961 etc/inet/sock2path needs some attention in OpenSolaris
author Anders Persson <Anders.Persson@Sun.COM>
date Tue, 10 Aug 2010 00:05:27 -0700
parents feaeaa778d1c
children b78e726e9922
files usr/src/cmd/cmd-inet/etc/Makefile usr/src/cmd/cmd-inet/etc/sock2path usr/src/cmd/cmd-inet/etc/sock2path.d/Makefile usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Fbpf usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Frds usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Frdsv3 usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Fsdp usr/src/cmd/cmd-inet/etc/sock2path.d/system%2Fkernel usr/src/cmd/cmd-inet/etc/sock2path.d/system%2Fnetwork%2Fhttp%2Fcache%2Faccelerator usr/src/cmd/cmd-inet/usr.sbin/soconfig.c usr/src/cmd/initpkg/inittab usr/src/cmd/svc/milestone/devices-local usr/src/lib/libsocket/socket/_soutil.c usr/src/lib/libsocket/socket/socket.c usr/src/pkg/manifests/driver-network-bpf.mf usr/src/pkg/manifests/driver-network-rds.mf usr/src/pkg/manifests/driver-network-rdsv3.mf usr/src/pkg/manifests/driver-network-sdp.mf usr/src/pkg/manifests/system-kernel.mf usr/src/pkg/manifests/system-network-http-cache-accelerator.mf usr/src/pkg/manifests/system-network.mf usr/src/uts/common/inet/sockmods/sockmod_pfp.c usr/src/uts/common/io/ib/clients/sdp/sdpddi.c
diffstat 23 files changed, 373 insertions(+), 116 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/cmd-inet/etc/Makefile	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/cmd/cmd-inet/etc/Makefile	Tue Aug 10 00:05:27 2010 -0700
@@ -18,17 +18,16 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
 
-SYMPROG= hosts inetd.conf networks protocols services netmasks sock2path
+SYMPROG= hosts inetd.conf networks protocols services netmasks
 
 # New /etc/inet files shouldn't have /etc entries.
 EDITPROG= ipaddrsel.conf ipsecalgs
 PROG= datemsk.ndpd ipsecinit.sample ipqosconf.1.sample ipqosconf.2.sample \
     ipqosconf.3.sample wanboot.conf.sample
 ETCPROG= $(SYMPROG) $(EDITPROG) $(PROG)
-SUBDIRS= default dhcp init.d ike nca ppp secret
+SUBDIRS= default dhcp init.d ike nca ppp secret sock2path.d
 
 include ../../Makefile.cmd
 
--- a/usr/src/cmd/cmd-inet/etc/sock2path	Mon Aug 09 20:07:20 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# socket configuration information
-#
-#     Family   Type  Protocol	Dev|Module
-	2	2	0	tcp
-	2	2	6	tcp
-
-	26	2	0	tcp
-	26	2	6	tcp
-
-	2	1	0	udp
-	2	1	17	udp
-
-	26	1	0	udp
-	26	1	17	udp
-
-	1	2	0	/dev/ticotsord
-	1	6	0	/dev/ticotsord
-	1	1	0	/dev/ticlts
-
-	2	4	0	icmp
-	26	4	0	icmp
-
-	2	2	132	socksctp
-	26	2	132	socksctp
-	2	6	132	socksctp
-	26	6	132	socksctp
-
-	24	4	0	rts
-
-	27	4	2	/dev/keysock
-	28	2	0	/dev/nca
-	29	4	1	/dev/spdsock
-
-	30	6	0	sockrds
-
-	31	1	0	trill
-	32	1	0	sockpfp
-	32	4	0	sockpfp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/Makefile	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,50 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# cmd/cmd-inet/etc/sock2path.d/Makefile
+#
+
+SOCK2PATHFILES= \
+    driver%2Fnetwork%2Fbpf \
+    driver%2Fnetwork%2Frds \
+    driver%2Fnetwork%2Frdsv3 \
+    driver%2Fnetwork%2Fsdp \
+    system%2Fkernel \
+    system%2Fnetwork%2Fhttp%2Fcache%2Faccelerator
+
+include ../../../Makefile.cmd
+
+ETCSOCK2PATHDIR=	$(ROOTETC)/sock2path.d
+ETCSOCK2PATHFILES=	$(SOCK2PATHFILES:%=$(ETCSOCK2PATHDIR)/%)
+
+FILEMODE=	0644
+
+.KEEP_STATE:
+
+all:
+install:	$(ETCSOCK2PATHDIR) $(ETCSOCK2PATHFILES)
+
+$(ETCSOCK2PATHDIR)/%: %
+		$(INS.file)
+
+$(ETCSOCK2PATHDIR):
+		$(INS.dir)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Fbpf	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,27 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# socket configuration information
+#
+#     Family   Type  Protocol	Dev|Module
+
+	32	1	0	sockpfp
+	32	4	0	sockpfp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Frds	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,26 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# socket configuration information
+#
+#     Family   Type  Protocol	Dev|Module
+
+	30	1	0	/dev/rds
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Frdsv3	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,26 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# socket configuration information
+#
+#     Family   Type  Protocol	Dev|Module
+
+	30	6	0	sockrds
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/driver%2Fnetwork%2Fsdp	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,27 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# socket configuration information
+#
+#     Family   Type  Protocol	Dev|Module
+
+	2	2	257	socksdp
+	26	2	257	socksdp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/system%2Fkernel	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,54 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# socket configuration information
+#
+#     Family   Type  Protocol	Dev|Module
+	2	2	0	tcp
+	2	2	6	tcp
+
+	26	2	0	tcp
+	26	2	6	tcp
+
+	2	1	0	udp
+	2	1	17	udp
+
+	26	1	0	udp
+	26	1	17	udp
+
+	1	2	0	/dev/ticotsord
+	1	6	0	/dev/ticotsord
+	1	1	0	/dev/ticlts
+
+	2	4	0	icmp
+	26	4	0	icmp
+
+	2	2	132	socksctp
+	26	2	132	socksctp
+	2	6	132	socksctp
+	26	6	132	socksctp
+
+	24	4	0	rts
+
+	27	4	2	/dev/keysock
+	29	4	1	/dev/spdsock
+
+	31	1	0	trill
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/cmd-inet/etc/sock2path.d/system%2Fnetwork%2Fhttp%2Fcache%2Faccelerator	Tue Aug 10 00:05:27 2010 -0700
@@ -0,0 +1,26 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# socket configuration information
+#
+#     Family   Type  Protocol	Dev|Module
+
+	28	2	0	/dev/nca
--- a/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c	Tue Aug 10 00:05:27 2010 -0700
@@ -22,22 +22,26 @@
  * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <locale.h>
 #include <stdio.h>
-#include <sys/stat.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
-#include <ctype.h>
-#include <locale.h>
 #include <sys/socket.h>
 #include <sys/socketvar.h>
-#include <errno.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #define	MAXLINELEN	4096
 
 /*
  * Usage:
- *	sonconfig -f <file>
+ *	soconfig -d <dir>
+ *		Reads input from files in dir.
+ *
+ *	soconfig -f <file>
  *		Reads input from file. The file is structured as
  *			 <fam> <type> <protocol> <path|module>
  *			 <fam> <type> <protocol>
@@ -60,12 +64,14 @@
  *		unconfigures filter
  */
 
+static int	parse_files_in_dir(const char *dir);
+
 static int	parse_file(char *filename);
 
 static int	split_line(char *line, char *argvec[], int maxargvec);
 
 static int	parse_params(char *famstr, char *typestr, char *protostr,
-				char *path, int line);
+				char *path, const char *file, int line);
 
 static int	parse_int(char *str);
 
@@ -93,16 +99,21 @@
 		ret = parse_filter_params(argc, argv);
 		exit(ret);
 	}
+	if (argc == 2 && strcmp(argv[0], "-d") == 0) {
+		ret = parse_files_in_dir(argv[1]);
+		exit(ret);
+	}
 	if (argc == 2 && strcmp(argv[0], "-f") == 0) {
 		ret = parse_file(argv[1]);
 		exit(ret);
 	}
 	if (argc == 3) {
-		ret = parse_params(argv[0], argv[1], argv[2], NULL, -1);
+		ret = parse_params(argv[0], argv[1], argv[2], NULL, NULL, -1);
 		exit(ret);
 	}
 	if (argc == 4) {
-		ret = parse_params(argv[0], argv[1], argv[2], argv[3], -1);
+		ret = parse_params(argv[0], argv[1], argv[2], argv[3],
+		    NULL, -1);
 		exit(ret);
 	}
 	usage();
@@ -114,12 +125,58 @@
 usage(void)
 {
 	fprintf(stderr, gettext(
-	    "Usage:	soconfig -f <file>\n"
+	    "Usage:	soconfig -d <dir>\n"
+	    "\tsoconfig -f <file>\n"
 	    "\tsoconfig <fam> <type> <protocol> <path|module>\n"
 	    "\tsoconfig <fam> <type> <protocol>\n"));
 }
 
 /*
+ * Parse all files in the given directory.
+ */
+static int
+parse_files_in_dir(const char *dirname)
+{
+	DIR		*dp;
+	struct dirent 	*dirp;
+	struct stat	stats;
+	char		buf[MAXPATHLEN];
+
+	if ((dp = opendir(dirname)) == NULL) {
+		fprintf(stderr, gettext("failed to open directory '%s': %s\n"),
+		    dirname, strerror(errno));
+		return (1);
+	}
+
+	while ((dirp = readdir(dp)) != NULL) {
+		if (dirp->d_name[0] == '.')
+			continue;
+
+		if (snprintf(buf, sizeof (buf), "%s/%s", dirname,
+		    dirp->d_name) >= sizeof (buf)) {
+			fprintf(stderr,
+			    gettext("path name is too long: %s/%s\n"),
+			    dirname, dirp->d_name);
+			continue;
+		}
+		if (stat(buf, &stats) == -1) {
+			fprintf(stderr,
+			    gettext("failed to stat '%s': %s\n"), buf,
+			    strerror(errno));
+			continue;
+		}
+		if (!S_ISREG(stats.st_mode))
+			continue;
+
+		(void) parse_file(buf);
+	}
+
+	closedir(dp);
+
+	return (0);
+}
+
+/*
  * Open the specified file and parse each line. Skip comments (everything
  * after a '#'). Return 1 if at least one error was encountered; otherwise 0.
  */
@@ -162,18 +219,19 @@
 			break;
 		case 3:
 			numerror += parse_params(argvec[0], argvec[1],
-			    argvec[2], NULL, linecount);
+			    argvec[2], NULL, filename, linecount);
 			break;
 		case 4:
 			numerror += parse_params(argvec[0], argvec[1],
-			    argvec[2], argvec[3], linecount);
+			    argvec[2], argvec[3], filename, linecount);
 			break;
 		default:
 			numerror++;
 			fprintf(stderr,
 			    gettext("Malformed line: <%s>\n"), line);
 			fprintf(stderr,
-			    gettext("\ton line %d\n"), linecount);
+			    gettext("\ton line %d in %s\n"), linecount,
+			    filename);
 			break;
 		}
 	}
@@ -229,7 +287,8 @@
  * If line is not -1 it is assumed to be the line number in the file.
  */
 static int
-parse_params(char *famstr, char *typestr, char *protostr, char *path, int line)
+parse_params(char *famstr, char *typestr, char *protostr, char *path,
+    const char *file, int line)
 {
 	int cmd, fam, type, protocol;
 
@@ -238,7 +297,7 @@
 		fprintf(stderr, gettext("Bad family number: %s\n"), famstr);
 		if (line != -1)
 			fprintf(stderr,
-			    gettext("\ton line %d\n"), line);
+			    gettext("\ton line %d in %s\n"), line, file);
 		else {
 			fprintf(stderr, "\n");
 			usage();
@@ -252,7 +311,7 @@
 		    gettext("Bad socket type number: %s\n"), typestr);
 		if (line != -1)
 			fprintf(stderr,
-			    gettext("\ton line %d\n"), line);
+			    gettext("\ton line %d in %s\n"), line, file);
 		else {
 			fprintf(stderr, "\n");
 			usage();
@@ -266,7 +325,7 @@
 		    gettext("Bad protocol number: %s\n"), protostr);
 		if (line != -1)
 			fprintf(stderr,
-			    gettext("\ton line %d\n"), line);
+			    gettext("\ton line %d in %s\n"), line, file);
 		else {
 			fprintf(stderr, "\n");
 			usage();
@@ -283,7 +342,8 @@
 			perror(path);
 			if (line != -1)
 				fprintf(stderr,
-				    gettext("\ton line %d\n"), line);
+				    gettext("\ton line %d in %s\n"), line,
+				    file);
 			else {
 				fprintf(stderr, "\n");
 				usage();
@@ -301,7 +361,25 @@
 	    cmd, fam, type, protocol, path == NULL ? "(null)" : path);
 #else
 	if (_sockconfig(cmd, fam, type, protocol, path) == -1) {
-		perror("sockconfig");
+		char *s;
+
+		switch (errno) {
+		case EEXIST:
+			s = gettext("Mapping exists");
+			break;
+		default:
+			s = strerror(errno);
+			break;
+		}
+
+		fprintf(stderr,
+		    gettext("warning: socket configuration failed "
+		    "for family %d type %d protocol %d: %s\n"),
+		    fam, type, protocol, s);
+		if (line != -1) {
+			fprintf(stderr,
+			    gettext("\ton line %d in %s\n"), line, file);
+		}
 		return (1);
 	}
 #endif
--- a/usr/src/cmd/initpkg/inittab	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/cmd/initpkg/inittab	Tue Aug 10 00:05:27 2010 -0700
@@ -1,9 +1,8 @@
 # CDDL HEADER START
 #
 # The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
 #
 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 # or http://www.opensolaris.org/os/licensing.
@@ -18,8 +17,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 # The /etc/inittab file controls the configuration of init(1M); for more
 # information refer to init(1M) and inittab(4).  It is no longer
@@ -36,8 +34,7 @@
 #	svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
 #	svc:/system/console-login> exit
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 ap::sysinit:/sbin/autopush -f /etc/iu.ap
-sp::sysinit:/sbin/soconfig -f /etc/sock2path
+sp::sysinit:/sbin/soconfig -d /etc/sock2path.d
 smf::sysinit:/lib/svc/bin/svc.startd	>/dev/msglog 2<>/dev/msglog </dev/console
 p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog
--- a/usr/src/cmd/svc/milestone/devices-local	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/cmd/svc/milestone/devices-local	Tue Aug 10 00:05:27 2010 -0700
@@ -43,7 +43,7 @@
 	# Rerun soconfig to configure any sockets that use /dev
 	# entries that were just created by devfsadm.
 	#
-	/sbin/soconfig -f /etc/sock2path >/dev/null 2>&1
+	/sbin/soconfig -d /etc/sock2path.d >/dev/null 2>&1
 
 	#
 	# Update kernel driver.conf cache.
--- a/usr/src/lib/libsocket/socket/_soutil.c	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/lib/libsocket/socket/_soutil.c	Tue Aug 10 00:05:27 2010 -0700
@@ -20,8 +20,7 @@
  */
 
 /*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -43,7 +42,7 @@
 
 /*
  * XXX The functions in this file are only needed to support transport
- * providers that have not yet been converted to use /etc/sock2path.
+ * providers that have not yet been converted to use /etc/sock2path.d.
  * Once all transport providers have been converted this file can be
  * removed.
  */
--- a/usr/src/lib/libsocket/socket/socket.c	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/lib/libsocket/socket/socket.c	Tue Aug 10 00:05:27 2010 -0700
@@ -2,9 +2,8 @@
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
@@ -20,8 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 1997 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -37,8 +35,6 @@
  * contributors.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/stropts.h>
@@ -100,12 +96,12 @@
 
 	/*
 	 * Try creating without knowing the device assuming that
-	 * the transport provider is registered in /etc/sock2path.
+	 * the transport provider is registered in /etc/sock2path.d.
 	 * If none found fall back to using /etc/netconfig to look
 	 * up the name of the transport device name. This provides
 	 * backwards compatibility for transport providers that have not
-	 * yet been converted to using /etc/sock2path.
-	 * XXX When all transport providers use /etc/sock2path this
+	 * yet been converted to using /etc/sock2path.d.
+	 * XXX When all transport providers use /etc/sock2path.d. this
 	 * part of the code can be removed.
 	 */
 	fd = _so_socket(family, type, protocol, NULL, version);
@@ -128,7 +124,7 @@
 			return (-1);
 		}
 		if (_s_netconfig_path(family, type, protocol,
-					&devpath, &prototype) == -1) {
+		    &devpath, &prototype) == -1) {
 			errno = saved_errno;
 			return (-1);
 		}
--- a/usr/src/pkg/manifests/driver-network-bpf.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/driver-network-bpf.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -29,6 +29,8 @@
 set name=info.classification \
     value=org.opensolaris.category.2008:Drivers/Networking
 set name=variant.arch value=$(ARCH)
+dir path=etc group=sys
+dir path=etc/sock2path.d group=sys
 dir path=usr group=sys
 dir path=usr/include
 dir path=usr/include/net
@@ -39,6 +41,7 @@
 dir path=usr/kernel/socketmod group=sys
 dir path=usr/kernel/socketmod/$(ARCH64) group=sys
 driver name=bpf perms="bpf 0666 root sys"
+file path=etc/sock2path.d/driver%2Fnetwork%2Fbpf group=sys
 file path=usr/include/net/bpf.h
 file path=usr/include/net/bpfdesc.h
 file path=usr/include/net/dlt.h
--- a/usr/src/pkg/manifests/driver-network-rds.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/driver-network-rds.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -35,11 +35,14 @@
 set name=info.classification \
     value=org.opensolaris.category.2008:System/Hardware
 set name=variant.arch value=$(ARCH)
+dir path=etc group=sys
+dir path=etc/sock2path.d group=sys
 dir path=kernel group=sys
 dir path=kernel/drv group=sys
 dir path=kernel/drv/$(ARCH64) group=sys
 driver name=rds perms="* 0644 root sys"
 driver name=rdsib perms="* 0644 root sys"
+file path=etc/sock2path.d/driver%2Fnetwork%2Frds group=sys
 file path=kernel/drv/$(ARCH64)/rds group=sys
 file path=kernel/drv/$(ARCH64)/rdsib group=sys
 $(i386_ONLY)file path=kernel/drv/rds group=sys
--- a/usr/src/pkg/manifests/driver-network-rdsv3.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/driver-network-rdsv3.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -36,6 +36,8 @@
 set name=info.classification \
     value=org.opensolaris.category.2008:System/Hardware
 set name=variant.arch value=$(ARCH)
+dir path=etc group=sys
+dir path=etc/sock2path.d group=sys
 dir path=kernel group=sys
 dir path=kernel/drv group=sys
 dir path=kernel/drv/$(ARCH64) group=sys
@@ -46,6 +48,7 @@
 dir path=usr/lib/rcm group=bin
 dir path=usr/lib/rcm/scripts group=bin
 driver name=rdsv3 perms="* 0644 root sys"
+file path=etc/sock2path.d/driver%2Fnetwork%2Frdsv3 group=sys
 file path=kernel/drv/$(ARCH64)/rdsv3 group=sys
 $(i386_ONLY)file path=kernel/drv/rdsv3 group=sys
 file path=kernel/drv/rdsv3.conf group=sys preserve=renamenew
--- a/usr/src/pkg/manifests/driver-network-sdp.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/driver-network-sdp.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -37,6 +37,7 @@
     value=org.opensolaris.category.2008:System/Hardware
 set name=variant.arch value=$(ARCH)
 dir path=etc group=sys
+dir path=etc/sock2path.d group=sys
 dir path=kernel group=sys
 dir path=kernel/drv group=sys
 dir path=kernel/drv/$(ARCH64) group=sys
@@ -45,6 +46,7 @@
 driver name=sdp perms="* 0644 root sys" perms="sdp 0666 root sys"
 file path=etc/sdp.conf group=sys original_name=SUNWibsdp:etc/sdp.conf \
     preserve=true
+file path=etc/sock2path.d/driver%2Fnetwork%2Fsdp group=sys
 file path=kernel/drv/$(ARCH64)/sdp group=sys
 $(i386_ONLY)file path=kernel/drv/sdp group=sys
 file path=kernel/drv/sdp.conf group=sys
--- a/usr/src/pkg/manifests/system-kernel.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/system-kernel.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -42,6 +42,7 @@
 dir path=boot/solaris/bin group=sys
 dir path=etc group=sys
 dir path=etc/crypto group=sys
+dir path=etc/sock2path.d group=sys
 dir path=kernel group=sys
 $(i386_ONLY)dir path=kernel/$(ARCH64) group=sys
 dir path=kernel/crypto group=sys
@@ -265,6 +266,7 @@
     original_name=SUNWckr:etc/crypto/kcf.conf preserve=true
 file path=etc/name_to_sysnum group=sys \
     original_name=SUNWckr:etc/name_to_sysnum preserve=renameold
+file path=etc/sock2path.d/system%2Fkernel group=sys
 file path=etc/system group=sys original_name=SUNWckr:etc/system preserve=true
 $(i386_ONLY)file path=kernel/$(ARCH64)/genunix group=sys mode=0755
 file path=kernel/crypto/$(ARCH64)/aes group=sys mode=0755
--- a/usr/src/pkg/manifests/system-network-http-cache-accelerator.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/system-network-http-cache-accelerator.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -42,6 +42,7 @@
 dir path=etc/rc1.d group=sys
 dir path=etc/rc2.d group=sys
 dir path=etc/rcS.d group=sys
+dir path=etc/sock2path.d group=sys
 dir path=kernel group=sys
 dir path=kernel/drv group=sys
 dir path=kernel/drv/$(ARCH64) group=sys
@@ -65,6 +66,8 @@
     original_name=SUNWnca:etc/nca/ncalogd.conf preserve=true
 file path=etc/nca/ncaport.conf group=sys \
     original_name=SUNWnca:etc/nca/ncaport.conf preserve=true
+file path=etc/sock2path.d/system%2Fnetwork%2Fhttp%2Fcache%2Faccelerator \
+    group=sys
 file path=kernel/drv/$(ARCH64)/nca group=sys
 $(i386_ONLY)file path=kernel/drv/nca group=sys
 file path=kernel/drv/nca.conf group=sys
--- a/usr/src/pkg/manifests/system-network.mf	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/pkg/manifests/system-network.mf	Tue Aug 10 00:05:27 2010 -0700
@@ -67,8 +67,6 @@
 file path=etc/inet/secret/ike.preshared group=sys mode=0600 \
     original_name=SUNWcnetr:etc/inet/secret/ike.preshared preserve=true
 file path=etc/inet/secret/ipseckeys.sample group=sys mode=0600
-file path=etc/inet/sock2path group=sys \
-    original_name=SUNWcnetr:etc/inet/sock2path preserve=renameold
 file path=etc/ipadm/ipadm.conf group=netadm owner=netadm preserve=true
 file path=etc/nwam/loc/NoNet/ipf.conf.dfl group=netadm owner=netadm \
     preserve=true
@@ -90,7 +88,6 @@
     vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
 license cr_Sun license=cr_Sun
 license lic_CDDL license=lic_CDDL
-link path=etc/sock2path target=./inet/sock2path
 user username=dladm ftpuser=false gcos-field="Datalink Admin" group=netadm \
     uid=15
 user username=netadm ftpuser=false gcos-field="Network Admin" group=netadm \
--- a/usr/src/uts/common/inet/sockmods/sockmod_pfp.c	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/uts/common/inet/sockmods/sockmod_pfp.c	Tue Aug 10 00:05:27 2010 -0700
@@ -20,8 +20,7 @@
  */
 
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #include <sys/types.h>
@@ -242,7 +241,7 @@
  * being used for reading packets from.
  *
  * This create function enforces this module only being used with PF_PACKET
- * sockets and the policy that we support via the sock2path.conf file:
+ * sockets and the policy that we support via the config file in sock2path.d:
  * PF_PACKET sockets must be either SOCK_DGRAM or SOCK_RAW.
  */
 /* ARGSUSED */
--- a/usr/src/uts/common/io/ib/clients/sdp/sdpddi.c	Mon Aug 09 20:07:20 2010 -0700
+++ b/usr/src/uts/common/io/ib/clients/sdp/sdpddi.c	Tue Aug 10 00:05:27 2010 -0700
@@ -19,8 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #include <sys/types.h>
@@ -55,10 +54,10 @@
 
 /*
  * This is a pseudo driver which creates an entry for /dev/sdp in the device
- * tree. A regular installation will end up modifying sock2path file announcing
- * support for sdp using AF_INET/SOCK_STREAM/PROTO_SDP parameters in socket
- * call. On a non IB hardware, following are the constraints within which
- * the sdp project operates. The sdpib driver which is the real driver
+ * tree. A regular installation will end up adding a file to sock2path.d
+ * announcing support for sdp using AF_INET/SOCK_STREAM/PROTO_SDP parameters in
+ * socket call. On a non IB hardware, following are the constraints within
+ * which the sdp project operates. The sdpib driver which is the real driver
  * (in terms of moving data) should not be loaded since it has dependency on
  * ibcm and ibtl modules which will be loaded in the memory. This will consume
  * precious memory and needs to be avoided. As a result the sdpib driver