PERFORCE change 144906 for review

Ed Schouten ed at FreeBSD.org
Tue Jul 8 19:17:24 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=144906

Change 144906 by ed at ed_dull on 2008/07/08 19:16:24

	IFC, to see whether integration works after moving mpsafetty to
	the projects space.

Affected files ...

.. //depot/projects/mpsafetty/include/unistd.h#2 integrate
.. //depot/projects/mpsafetty/lib/libgeom/geom_ctl.c#2 integrate
.. //depot/projects/mpsafetty/lib/libgeom/geom_getxml.c#2 integrate
.. //depot/projects/mpsafetty/lib/libgeom/geom_xml2tree.c#2 integrate
.. //depot/projects/mpsafetty/libexec/pt_chown/Makefile#1 branch
.. //depot/projects/mpsafetty/libexec/pt_chown/pt_chown.c#1 branch
.. //depot/projects/mpsafetty/share/man/man4/ddb.4#2 integrate
.. //depot/projects/mpsafetty/share/man/man4/malo.4#2 integrate
.. //depot/projects/mpsafetty/share/man/man4/pty.4#1 branch
.. //depot/projects/mpsafetty/share/misc/committers-src.dot#2 integrate
.. //depot/projects/mpsafetty/sys/amd64/amd64/minidump_machdep.c#2 integrate
.. //depot/projects/mpsafetty/sys/amd64/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/i386/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/ia64/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/kern/tty.c#2 integrate
.. //depot/projects/mpsafetty/sys/kern/tty_conf.c#1 branch
.. //depot/projects/mpsafetty/sys/kern/tty_pts.c#1 branch
.. //depot/projects/mpsafetty/sys/kern/tty_pty.c#1 branch
.. //depot/projects/mpsafetty/sys/netgraph/ng_iface.c#2 integrate
.. //depot/projects/mpsafetty/sys/netgraph/ng_ip_input.c#2 integrate
.. //depot/projects/mpsafetty/sys/netinet/in_pcb.h#2 integrate
.. //depot/projects/mpsafetty/sys/netinet6/in6_pcb.c#2 integrate
.. //depot/projects/mpsafetty/sys/netinet6/in6_src.c#2 integrate
.. //depot/projects/mpsafetty/sys/netinet6/ip6_var.h#2 integrate
.. //depot/projects/mpsafetty/sys/netinet6/raw_ip6.c#2 integrate
.. //depot/projects/mpsafetty/sys/netinet6/udp6_usrreq.c#2 integrate
.. //depot/projects/mpsafetty/sys/pc98/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/powerpc/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/sparc64/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/sun4v/conf/GENERIC#2 integrate
.. //depot/projects/mpsafetty/sys/sys/linedisc.h#1 branch
.. //depot/projects/mpsafetty/sys/sys/tty.h#2 integrate
.. //depot/projects/mpsafetty/usr.bin/calendar/calendars/calendar.freebsd#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/pkg_install/create/main.c#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/pkg_install/lib/lib.h#2 integrate

Differences ...

==== //depot/projects/mpsafetty/include/unistd.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)unistd.h	8.12 (Berkeley) 4/27/95
- * $FreeBSD: src/include/unistd.h,v 1.89 2008/06/23 05:22:06 ed Exp $
+ * $FreeBSD: src/include/unistd.h,v 1.90 2008/07/08 03:08:32 davidxu Exp $
  */
 
 #ifndef _UNISTD_H_
@@ -107,7 +107,7 @@
 #define	_POSIX_READER_WRITER_LOCKS	200112L
 #define	_POSIX_REGEXP			1
 #define	_POSIX_SHELL			1
-#define	_POSIX_SPAWN			-1
+#define	_POSIX_SPAWN			200112L
 #define	_POSIX_SPIN_LOCKS		200112L
 #define	_POSIX_THREAD_ATTR_STACKADDR	200112L
 #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L

==== //depot/projects/mpsafetty/lib/libgeom/geom_ctl.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libgeom/geom_ctl.c,v 1.4 2003/06/01 15:05:22 phk Exp $
+ * $FreeBSD: src/lib/libgeom/geom_ctl.c,v 1.5 2008/07/08 17:34:50 lulf Exp $
  */
 
 #include <stdio.h>
@@ -45,6 +45,12 @@
 #define GCTL_TABLE 1
 #include <libgeom.h>
 
+/* 
+ * Global pointer to a string that is used to avoid an errorneous free in
+ * gctl_free.
+ */
+static char nomemmsg[] = "Could not allocate memory";
+
 void
 gctl_dump(struct gctl_req *req, FILE *f)
 {
@@ -105,11 +111,12 @@
 static void
 gctl_check_alloc(struct gctl_req *req, void *ptr)
 {
+
 	if (ptr != NULL)
 		return;
-	gctl_set_error(req, "Could not allocate memory");
+	gctl_set_error(req, nomemmsg);
 	if (req->error == NULL)
-		req->error = "Could not allocate memory";
+		req->error = nomemmsg;
 }
 
 /*
@@ -134,7 +141,7 @@
 	struct gctl_req_arg *ap;
 
 	req->narg++;
-	req->arg = realloc(req->arg, sizeof *ap * req->narg);
+	req->arg = reallocf(req->arg, sizeof *ap * req->narg);
 	gctl_check_alloc(req, req->arg);
 	if (req->arg == NULL) {
 		req->narg = 0;
@@ -157,6 +164,8 @@
 		return;
 	ap->name = strdup(name);
 	gctl_check_alloc(req, ap->name);
+	if (ap->name == NULL)
+		return;
 	ap->nlen = strlen(ap->name) + 1;
 	ap->value = __DECONST(void *, value);
 	ap->flag = GCTL_PARAM_RD;
@@ -180,6 +189,8 @@
 		return;
 	ap->name = strdup(name);
 	gctl_check_alloc(req, ap->name);
+	if (ap->name == NULL)
+		return;
 	ap->nlen = strlen(ap->name) + 1;
 	ap->value = value;
 	ap->flag = GCTL_PARAM_RW;
@@ -201,12 +212,11 @@
 
 	req->version = GCTL_VERSION;
 	req->lerror = BUFSIZ;		/* XXX: arbitrary number */
-	req->error = malloc(req->lerror);
+	req->error = calloc(1, req->lerror);
 	if (req->error == NULL) {
 		gctl_check_alloc(req, req->error);
 		return (req->error);
 	}
-	memset(req->error, 0, req->lerror);
 	req->lerror--;
 	fd = open(_PATH_DEV PATH_GEOM_CTL, O_RDONLY);
 	if (fd < 0)
@@ -232,7 +242,7 @@
 			free(req->arg[i].name);
 	}
 	free(req->arg);
-	if (req->error != NULL)
+	if (req->error != NULL && req->error != nomemmsg)
 		free(req->error);
 	free(req);
 }

==== //depot/projects/mpsafetty/lib/libgeom/geom_getxml.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libgeom/geom_getxml.c,v 1.2 2007/05/01 10:47:09 wkoszek Exp $
+ * $FreeBSD: src/lib/libgeom/geom_getxml.c,v 1.3 2008/07/08 17:34:50 lulf Exp $
  */
 
 #include <sys/types.h>
@@ -39,28 +39,22 @@
 geom_getxml()
 {
 	char *p;
-	size_t l;
-	int i;
+	size_t l = 0;
+	int mib[3];
+	size_t sizep;
 
-	l = 1024 * 1024;	/* Start big, realloc back */
+	sizep = sizeof(mib) / sizeof(*mib);
+	if (sysctlnametomib("kern.geom.confxml", mib, &sizep) != 0)
+		return (NULL);
+	if (sysctl(mib, sizep, NULL, &l, NULL, 0) != 0)
+		return (NULL);
+	l += 4096;
 	p = malloc(l);
-	if (p) {
-		i = sysctlbyname("kern.geom.confxml", p, &l, NULL, 0);
-		if (i == 0) {
-			p = realloc(p, strlen(p) + 1);
-			return (p);
-		}
+	if (p == NULL)
+		return (NULL);
+	if (sysctl(mib, sizep, p, &l, NULL, 0) != 0) {
 		free(p);
-	}
-	l = 0;
-	i = sysctlbyname("kern.geom.confxml", NULL, &l, NULL, 0);
-	if (i != 0)
 		return (NULL);
-	p = malloc(l + 4096);
-	i = sysctlbyname("kern.geom.confxml", p, &l, NULL, 0);
-	if (i == 0) {
-		p = realloc(p, strlen(p) + 1);
-		return (p);
 	}
-	return (NULL);
+	return (reallocf(p, strlen(p) + 1));
 }

==== //depot/projects/mpsafetty/lib/libgeom/geom_xml2tree.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libgeom/geom_xml2tree.c,v 1.5 2005/05/24 10:10:38 phk Exp $
+ * $FreeBSD: src/lib/libgeom/geom_xml2tree.c,v 1.6 2008/07/08 17:34:50 lulf Exp $
  */
 
 #include <stdio.h>
@@ -84,6 +84,11 @@
 	}
 	if (!strcmp(name, "class") && mt->class == NULL) {
 		mt->class = calloc(1, sizeof *mt->class);
+		if (mt->class == NULL) {
+			warn("Cannot allocate memory during processing of '%s' "
+			    "element", name);
+			return;
+		}
 		mt->class->lg_id = id;
 		LIST_INSERT_HEAD(&mt->mesh->lg_class, mt->class, lg_class);
 		LIST_INIT(&mt->class->lg_geom);
@@ -92,6 +97,11 @@
 	}
 	if (!strcmp(name, "geom") && mt->geom == NULL) {
 		mt->geom = calloc(1, sizeof *mt->geom);
+		if (mt->geom == NULL) {
+			warn("Cannot allocate memory during processing of '%s' "
+			    "element", name);
+			return;
+		}
 		mt->geom->lg_id = id;
 		LIST_INSERT_HEAD(&mt->class->lg_geom, mt->geom, lg_geom);
 		LIST_INIT(&mt->geom->lg_provider);
@@ -105,6 +115,11 @@
 	}
 	if (!strcmp(name, "consumer") && mt->consumer == NULL) {
 		mt->consumer = calloc(1, sizeof *mt->consumer);
+		if (mt->consumer == NULL) {
+			warn("Cannot allocate memory during processing of '%s' "
+			    "element", name);
+			return;
+		}
 		mt->consumer->lg_id = id;
 		LIST_INSERT_HEAD(&mt->geom->lg_consumer, mt->consumer,
 		    lg_consumer);
@@ -121,6 +136,11 @@
 	}
 	if (!strcmp(name, "provider") && mt->provider == NULL) {
 		mt->provider = calloc(1, sizeof *mt->provider);
+		if (mt->provider == NULL) {
+			warn("Cannot allocate memory during processing of '%s' "
+			    "element", name);
+			return;
+		}
 		mt->provider->lg_id = id;
 		LIST_INSERT_HEAD(&mt->geom->lg_provider, mt->provider,
 		    lg_provider);
@@ -162,6 +182,11 @@
 	mt = userData;
 	sbuf_finish(mt->sbuf[mt->level]);
 	p = strdup(sbuf_data(mt->sbuf[mt->level]));
+	if (p == NULL) {
+		warn("Cannot allocate memory during processing of '%s' "
+		    "element", name);
+		return;
+	}
 	sbuf_delete(mt->sbuf[mt->level]);
 	mt->sbuf[mt->level] = NULL;
 	mt->level--;
@@ -212,8 +237,18 @@
 	}
 
 	if (mt->config != NULL) {
-		gc = calloc(sizeof *gc, 1);
+		gc = calloc(1, sizeof *gc);
+		if (gc == NULL) {
+			warn("Cannot allocate memory during processing of '%s' "
+			    "element", name);
+			return;
+		}
 		gc->lg_name = strdup(name);
+		if (gc->lg_name == NULL) {
+			warn("Cannot allocate memory during processing of '%s' "
+			    "element", name);
+			return;
+		}
 		gc->lg_val = p;
 		LIST_INSERT_HEAD(mt->config, gc, lg_config);
 		return;

==== //depot/projects/mpsafetty/share/man/man4/ddb.4#2 (text+ko) ====

@@ -58,9 +58,9 @@
 .\" 	Created.
 .\" 	[90/08/30            dbg]
 .\"
-.\" $FreeBSD: src/share/man/man4/ddb.4,v 1.53 2008/06/08 21:08:20 wkoszek Exp $
+.\" $FreeBSD: src/share/man/man4/ddb.4,v 1.54 2008/07/07 21:32:02 bz Exp $
 .\"
-.Dd June 8, 2008
+.Dd July 7, 2008
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -584,6 +584,13 @@
 Show brief information about the TTY subsystem.
 .\"
 .Pp
+.It Ic show Cm cpusets
+Print numbered root and assigned CPU affinity sets.
+See
+.Xr cpuset 2
+for more details.
+.\"
+.Pp
 .It Ic show Cm cyrixreg
 Show registers specific to the Cyrix processor.
 .\"

==== //depot/projects/mpsafetty/share/man/man4/malo.4#2 (text+ko) ====

@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGES.
 .\"
-.\" $FreeBSD: src/share/man/man4/malo.4,v 1.5 2008/07/07 02:39:39 weongyo Exp $
+.\" $FreeBSD: src/share/man/man4/malo.4,v 1.6 2008/07/08 04:15:07 weongyo Exp $
 .\"/
 .Dd April 13, 2008
 .Dt MALO 4
@@ -108,12 +108,6 @@
 ifconfig wlan create wlandev malo0 ssid my_net \e
 	wepmode on wepkey 0x1234567890 weptxkey 1 up
 .Ed
-.Pp
-Join a specific BSS network with 128-bit WEP encryption:
-.Bd -literal -offset indent
-ifconfig wlan create wlandev malo0 wlanmode adhoc ssid my_net \e
-    wepmode on wepkey 0x01020304050607080910111213 weptxkey 1
-.Ed
 .Sh SEE ALSO
 .Xr cardbus 4 ,
 .Xr pci 4 ,

==== //depot/projects/mpsafetty/share/misc/committers-src.dot#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/share/misc/committers-src.dot,v 1.79 2008/07/03 21:45:25 cokane Exp $
+# $FreeBSD: src/share/misc/committers-src.dot,v 1.80 2008/07/08 15:36:44 sson Exp $
 
 # This file is meant to list all FreeBSD src committers and describe the
 # mentor-mentee relationships between them.
@@ -160,6 +160,7 @@
 shiba [label="Takeshi Shibagaki\nshiba at FreeBSD.org\n2000/06/19"]
 simon [label="Simon L. Nielsen\nsimon at FreeBSD.org\n2006/03/07"]
 sobomax [label="Maxim Sobolev\nsobomax at FreeBSD.org\n2001/07/25"]
+sson [label="Stacey Son\nsson at FreeBSD.org\n2008/07/08"]
 suz [label="SUZUKI Shinsuke\nsuz at FreeBSD.org\n2002/03/26"]
 syrinx [label="Shteryana Shopova\nsyrinx at FreeBSD.org\n2006/10/07"]
 takawata [label="Takanori Watanabe\ntakawata at FreeBSD.org\n2000/07/06"]
@@ -278,6 +279,8 @@
 jake -> robert
 jake -> yongari
 
+jb -> sson
+
 jdp -> fjoe
 
 jhb -> arr

==== //depot/projects/mpsafetty/sys/amd64/amd64/minidump_machdep.c#2 (text) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/minidump_machdep.c,v 1.5 2008/06/20 20:59:31 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/minidump_machdep.c,v 1.6 2008/07/08 04:00:22 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -206,7 +206,8 @@
 	/* Walk page table pages, set bits in vm_page_dump */
 	ptesize = 0;
 	pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
-	for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
+	for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
+	    kernel_vm_end); va += NBPDR) {
 		i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
 		/*
 		 * We always write a page, even if it is zero. Each
@@ -312,7 +313,8 @@
 
 	/* Dump kernel page table pages */
 	pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
-	for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
+	for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
+	    kernel_vm_end); va += NBPDR) {
 		i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
 		/* We always write a page, even if it is zero */
 		if ((pdp[i] & PG_V) == 0) {

==== //depot/projects/mpsafetty/sys/amd64/conf/GENERIC#2 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.502 2008/06/20 19:28:33 delphij Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.503 2008/07/07 22:55:11 delphij Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -64,6 +64,7 @@
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
 options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
 options 	AUDIT			# Security event auditing
+options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 
 # Debugging for use in -current
 options 	KDB			# Enable kernel debugger support.

==== //depot/projects/mpsafetty/sys/i386/conf/GENERIC#2 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.492 2008/06/20 19:28:33 delphij Exp $
+# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.493 2008/07/07 22:55:11 delphij Exp $
 
 cpu		I486_CPU
 cpu		I586_CPU
@@ -63,6 +63,7 @@
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
 options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
+options  	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 
 # Debugging for use in -current

==== //depot/projects/mpsafetty/sys/ia64/conf/GENERIC#2 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.97 2008/04/15 05:02:41 marcel Exp $
+# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.98 2008/07/07 22:55:11 delphij Exp $
 
 cpu		ITANIUM
 ident		GENERIC
@@ -63,6 +63,7 @@
 options 	WITNESS		# Enable checks to detect deadlocks and cycles
 options 	WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
 options 	_KPOSIX_PRIORITY_SCHEDULING	# Posix P1003_1B RT extensions
+options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 
 # Various "busses"
 device		firewire	# FireWire bus code

==== //depot/projects/mpsafetty/sys/kern/tty.c#2 (text+ko) ====


==== //depot/projects/mpsafetty/sys/netgraph/ng_iface.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
  *
  * Author: Archie Cobbs <archie at freebsd.org>
  *
- * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.48 2008/01/31 08:51:48 mav Exp $
+ * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.49 2008/07/08 18:21:44 gonzo Exp $
  * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $
  */
 
@@ -755,7 +755,7 @@
 	/* First chunk of an mbuf contains good junk */
 	if (harvest.point_to_point)
 		random_harvest(m, 16, 3, 0, RANDOM_NET);
-	netisr_dispatch(isr, m);
+	netisr_queue(isr, m);
 	return (0);
 }
 

==== //depot/projects/mpsafetty/sys/netgraph/ng_ip_input.c#2 (text+ko) ====

@@ -64,7 +64,7 @@
  * Author:		Brooks Davis <brooks at FreeBSD.org>
  * Derived from:	ng_hole.c
  *
- * $FreeBSD: src/sys/netgraph/ng_ip_input.c,v 1.4 2005/01/07 01:45:39 imp Exp $
+ * $FreeBSD: src/sys/netgraph/ng_ip_input.c,v 1.5 2008/07/08 18:21:44 gonzo Exp $
  */
 
 /*
@@ -120,7 +120,7 @@
 
 	NGI_GET_M(item, m);
 	NG_FREE_ITEM(item);
-	netisr_dispatch(NETISR_IP, m);
+	netisr_queue(NETISR_IP, m);
 	return 0;
 }
 

==== //depot/projects/mpsafetty/sys/netinet/in_pcb.h#2 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)in_pcb.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.106 2008/05/09 23:02:57 julian Exp $
+ * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.107 2008/07/08 17:22:59 rwatson Exp $
  */
 
 #ifndef _NETINET_IN_PCB_H_
@@ -115,17 +115,49 @@
 
 struct	icmp6_filter;
 
+/*-
+ * struct inpcb captures the network layer state for TCP, UDP, and raw IPv4
+ * and IPv6 sockets.  In the case of TCP, further per-connection state is
+ * hung off of inp_ppcb most of the time.  Almost all fields of struct inpcb
+ * are static after creation or protected by a per-inpcb rwlock, inp_lock.  A
+ * few fields also require the global pcbinfo lock for the inpcb to be held,
+ * when modified, such as the global connection lists and hashes, as well as
+ * binding information (which affects which hash a connection is on).  This
+ * model means that connections can be looked up without holding the
+ * per-connection lock, which is important for performance when attempting to
+ * find the connection for a packet given its IP and port tuple.  Writing to
+ * these fields that write locks be held on both the inpcb and global locks.
+ *
+ * Key:
+ * (c) - Constant after initialization
+ * (i) - Protected by the inpcb lock
+ * (p) - Protected by the pcbinfo lock for the inpcb
+ * (s) - Protected by another subsystem's locks
+ * (x) - Undefined locking
+ *
+ * A few other notes:
+ *
+ * When a read lock is held, stability of the field is guaranteed; to write
+ * to a field, a write lock must generally be held.
+ *
+ * netinet/netinet6-layer code should not assume that the inp_socket pointer
+ * is safe to dereference without inp_lock being held, even for protocols
+ * other than TCP (where the inpcb persists during TIMEWAIT even after the
+ * socket has been freed), or there may be close(2)-related races.
+ *
+ * The inp_vflag field is overloaded, and would otherwise ideally be (c).
+ */
 struct inpcb {
-	LIST_ENTRY(inpcb) inp_hash;	/* hash list */
-	LIST_ENTRY(inpcb) inp_list;	/* list for all PCBs of this proto */
-	void	*inp_ppcb;		/* pointer to per-protocol pcb */
-	struct	inpcbinfo *inp_pcbinfo;	/* PCB list info */
-	struct	socket *inp_socket;	/* back pointer to socket */
+	LIST_ENTRY(inpcb) inp_hash;	/* (i/p) hash list */
+	LIST_ENTRY(inpcb) inp_list;	/* (i/p) list for all PCBs for proto */
+	void	*inp_ppcb;		/* (i) pointer to per-protocol pcb */
+	struct	inpcbinfo *inp_pcbinfo;	/* (c) PCB list info */
+	struct	socket *inp_socket;	/* (i)  back pointer to socket */
 
-	u_int32_t	inp_flow;
-	int	inp_flags;		/* generic IP/datagram flags */
+	u_int32_t	inp_flow;	/* (i) IPv6 flow information */
+	int	inp_flags;		/* (i) generic IP/datagram flags */
 
-	u_char	inp_vflag;		/* IP version flag (v4/v6) */
+	u_char	inp_vflag;		/* (i) IP version flag (v4/v6) */
 #define	INP_IPV4	0x1
 #define	INP_IPV6	0x2
 #define	INP_IPV6PROTO	0x4		/* opened under IPv6 protocol */
@@ -133,24 +165,24 @@
 #define	INP_ONESBCAST	0x10		/* send all-ones broadcast */
 #define	INP_DROPPED	0x20		/* protocol drop flag */
 #define	INP_SOCKREF	0x40		/* strong socket reference */
-	u_char	inp_ip_ttl;		/* time to live proto */
-	u_char	inp_ip_p;		/* protocol proto */
-	u_char	inp_ip_minttl;		/* minimum TTL or drop */
-	uint32_t inp_ispare1;		/* connection id / queue id */
-	void	*inp_pspare[2];		/* rtentry / general use */
+	u_char	inp_ip_ttl;		/* (i) time to live proto */
+	u_char	inp_ip_p;		/* (c) protocol proto */
+	u_char	inp_ip_minttl;		/* (i) minimum TTL or drop */
+	uint32_t inp_ispare1;		/* (x) connection id / queue id */
+	void	*inp_pspare[2];		/* (x) rtentry / general use */
 
 	/* Local and foreign ports, local and foreign addr. */
 	struct	in_conninfo inp_inc;
 
-					/* list for this PCB's local port */
-	struct	label *inp_label;	/* MAC label */
-	struct	inpcbpolicy *inp_sp;    /* for IPSEC */
+					/* (i/p) list for PCB's local port */
+	struct	label *inp_label;	/* (i) MAC label */
+	struct	inpcbpolicy *inp_sp;    /* (s) for IPSEC */
 
 	/* Protocol-dependent part; options. */
 	struct {
-		u_char	inp4_ip_tos;		/* type of service proto */
-		struct	mbuf *inp4_options;	/* IP options */
-		struct	ip_moptions *inp4_moptions; /* IP multicast options */
+		u_char	inp4_ip_tos;		/* (i) type of service proto */
+		struct	mbuf *inp4_options;	/* (i) IP options */
+		struct	ip_moptions *inp4_moptions; /* (i) IP multicast options */
 	} inp_depend4;
 #define	inp_fport	inp_inc.inc_fport
 #define	inp_lport	inp_inc.inc_lport
@@ -160,22 +192,22 @@
 #define	inp_options	inp_depend4.inp4_options
 #define	inp_moptions	inp_depend4.inp4_moptions
 	struct {
-		/* IP options */
+		/* (i) IP options */
 		struct	mbuf *inp6_options;
-		/* IP6 options for outgoing packets */
+		/* (i) IP6 options for outgoing packets */
 		struct	ip6_pktopts *inp6_outputopts;
-		/* IP multicast options */
+		/* (i) IP multicast options */
 		struct	ip6_moptions *inp6_moptions;
-		/* ICMPv6 code type filter */
+		/* (i) ICMPv6 code type filter */
 		struct	icmp6_filter *inp6_icmp6filt;
-		/* IPV6_CHECKSUM setsockopt */
+		/* (i) IPV6_CHECKSUM setsockopt */
 		int	inp6_cksum;
 		short	inp6_hops;
 	} inp_depend6;
-	LIST_ENTRY(inpcb) inp_portlist;
-	struct	inpcbport *inp_phd;	/* head of this list */
+	LIST_ENTRY(inpcb) inp_portlist;	/* (i/p) */
+	struct	inpcbport *inp_phd;	/* (i/p) head of this list */
 #define inp_zero_size offsetof(struct inpcb, inp_gencnt)
-	inp_gen_t	inp_gencnt;	/* generation count of this instance */
+	inp_gen_t	inp_gencnt;	/* (c) generation count of this instance */
 	struct rwlock	inp_lock;
 
 #define	in6p_faddr	inp_inc.inc6_faddr

==== //depot/projects/mpsafetty/sys/netinet6/in6_pcb.c#2 (text+ko) ====

@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.90 2008/04/19 14:36:19 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.91 2008/07/08 18:41:36 bz Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -317,8 +317,9 @@
 	 * Is it the intended behavior?
 	 */
 	*plocal_addr6 = in6_selectsrc(sin6, inp->in6p_outputopts,
-				      inp->in6p_moptions, NULL,
-				      &inp->in6p_laddr, &ifp, &error);
+				      inp, NULL,
+				      inp->inp_socket->so_cred,
+				      &ifp, &error);
 	if (ifp && scope_ambiguous &&
 	    (error = in6_setscope(&sin6->sin6_addr, ifp, NULL)) != 0) {
 		return(error);

==== //depot/projects/mpsafetty/sys/netinet6/in6_src.c#2 (text+ko) ====

@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet6/in6_src.c,v 1.51 2008/04/17 21:38:17 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet6/in6_src.c,v 1.52 2008/07/08 18:41:36 bz Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -170,8 +170,8 @@
 
 struct in6_addr *
 in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
-    struct ip6_moptions *mopts, struct route_in6 *ro,
-    struct in6_addr *laddr, struct ifnet **ifpp, int *errorp)
+    struct inpcb *inp, struct route_in6 *ro, struct ucred *cred,
+    struct ifnet **ifpp, int *errorp)
 {
 	struct in6_addr dst;
 	struct ifnet *ifp = NULL;
@@ -181,12 +181,18 @@
 	struct in6_addrpolicy *dst_policy = NULL, *best_policy = NULL;
 	u_int32_t odstzone;
 	int prefer_tempaddr;
+	struct ip6_moptions *mopts;
 
 	dst = dstsock->sin6_addr; /* make a copy for local operation */
 	*errorp = 0;
 	if (ifpp)
 		*ifpp = NULL;
 
+	if (inp != NULL)
+		mopts = inp->in6p_moptions;
+	else
+		mopts = NULL;
+
 	/*
 	 * If the source address is explicitly specified by the caller,
 	 * check if the requested source address is indeed a unicast address
@@ -236,8 +242,9 @@
 	/*
 	 * Otherwise, if the socket has already bound the source, just use it.
 	 */
-	if (laddr && !IN6_IS_ADDR_UNSPECIFIED(laddr))
-		return (laddr);
+	if (inp != NULL && !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) {
+		return (&inp->in6p_laddr);
+	}
 
 	/*
 	 * If the address is not specified, choose the best one based on

==== //depot/projects/mpsafetty/sys/netinet6/ip6_var.h#2 (text+ko) ====

@@ -58,7 +58,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)ip_var.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/netinet6/ip6_var.h,v 1.42 2008/05/24 15:20:48 bz Exp $
+ * $FreeBSD: src/sys/netinet6/ip6_var.h,v 1.43 2008/07/08 18:41:36 bz Exp $
  */
 
 #ifndef _NETINET6_IP6_VAR_H_
@@ -391,9 +391,9 @@
 int	dest6_input __P((struct mbuf **, int *, int));
 int	none_input __P((struct mbuf **, int *, int));
 
-struct in6_addr *in6_selectsrc __P((struct sockaddr_in6 *,
-	struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *,
-	struct in6_addr *, struct ifnet **, int *));
+struct in6_addr *in6_selectsrc __P((struct sockaddr_in6 *, struct ip6_pktopts *,
+	struct inpcb *inp, struct route_in6 *, struct ucred *cred,
+	struct ifnet **, int *));
 int in6_selectroute __P((struct sockaddr_in6 *, struct ip6_pktopts *,
 	struct ip6_moptions *, struct route_in6 *, struct ifnet **,
 	struct rtentry **, int));

==== //depot/projects/mpsafetty/sys/netinet6/raw_ip6.c#2 (text+ko) ====

@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.79 2008/07/05 18:03:39 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.80 2008/07/08 18:41:36 bz Exp $");
 
 #include "opt_ipsec.h"
 #include "opt_inet6.h"
@@ -387,8 +387,8 @@
 	/*
 	 * Source address selection.
 	 */
-	if ((in6a = in6_selectsrc(dstsock, optp, in6p->in6p_moptions, NULL,
-	    &in6p->in6p_laddr, &oifp, &error)) == NULL) {
+	if ((in6a = in6_selectsrc(dstsock, optp, in6p, NULL, so->so_cred,
+	    &oifp, &error)) == NULL) {
 		if (error == 0)
 			error = EADDRNOTAVAIL;
 		goto bad;
@@ -712,8 +712,8 @@
 	INP_WLOCK(inp);
 	/* Source address selection. XXX: need pcblookup? */
 	in6a = in6_selectsrc(addr, inp->in6p_outputopts,
-			     inp->in6p_moptions, NULL,
-			     &inp->in6p_laddr, &ifp, &error);
+			     inp, NULL, so->so_cred,
+			     &ifp, &error);
 	if (in6a == NULL) {
 		INP_WUNLOCK(inp);
 		INP_INFO_WUNLOCK(&ripcbinfo);

==== //depot/projects/mpsafetty/sys/netinet6/udp6_usrreq.c#2 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet6/udp6_usrreq.c,v 1.89 2008/07/07 10:11:17 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet6/udp6_usrreq.c,v 1.91 2008/07/08 18:41:36 bz Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -580,8 +580,8 @@
 		}
 
 		if (!IN6_IS_ADDR_V4MAPPED(faddr)) {
-			laddr = in6_selectsrc(sin6, optp, inp->in6p_moptions,
-			    NULL, &inp->in6p_laddr, &oifp, &error);
+			laddr = in6_selectsrc(sin6, optp, inp, NULL,
+			    td->td_ucred, &oifp, &error);
 			if (oifp && scope_ambiguous &&
 			    (error = in6_setscope(&sin6->sin6_addr,
 			    oifp, NULL))) {
@@ -1015,6 +1015,8 @@
 	.pru_send =		udp6_send,
 	.pru_shutdown =		udp_shutdown,
 	.pru_sockaddr =		in6_mapped_sockaddr,
+	.pru_soreceive =	soreceive_dgram,
+	.pru_sosend =		sosend_dgram,
 	.pru_sosetlabel =	in_pcbsosetlabel,
 	.pru_close =		udp6_close
 };

==== //depot/projects/mpsafetty/sys/pc98/conf/GENERIC#2 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/pc98/conf/GENERIC,v 1.306 2008/05/17 23:50:00 remko Exp $
+# $FreeBSD: src/sys/pc98/conf/GENERIC,v 1.307 2008/07/07 22:55:11 delphij Exp $
 
 cpu		I486_CPU
 cpu		I586_CPU
@@ -65,6 +65,7 @@
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
+options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 
 # Debugging for use in -current

==== //depot/projects/mpsafetty/sys/powerpc/conf/GENERIC#2 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
-# $FreeBSD: src/sys/powerpc/conf/GENERIC,v 1.79 2008/06/07 22:58:32 marcel Exp $
+# $FreeBSD: src/sys/powerpc/conf/GENERIC,v 1.80 2008/07/07 22:55:11 delphij Exp $
 
 cpu		AIM
 ident		GENERIC
@@ -62,6 +62,7 @@
 options 	SYSVMSG			#SYSV-style message queues
 options 	SYSVSEM			#SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 
 # Debugging for use in -current

==== //depot/projects/mpsafetty/sys/sparc64/conf/GENERIC#2 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.137 2008/05/17 23:50:00 remko Exp $
+# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.138 2008/07/07 22:55:11 delphij Exp $
 
 cpu		SUN4U
 ident		GENERIC
@@ -63,6 +63,7 @@
 options 	SYSVMSG			# SYSV-style message queues
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
+options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 
 # Debugging for use in -current

==== //depot/projects/mpsafetty/sys/sun4v/conf/GENERIC#2 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/sun4v/conf/GENERIC,v 1.18 2008/05/21 03:36:53 obrien Exp $
+# $FreeBSD: src/sys/sun4v/conf/GENERIC,v 1.19 2008/07/07 22:55:11 delphij Exp $
 
 cpu		SUN4V
 ident		GENERIC
@@ -64,6 +64,7 @@
 options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
 					# output.  Adds ~128k to driver.
 options 	PRINTF_BUFR_SIZE=128	# Prevent printf output being interspersed.
+options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 
 # Debugging for use in -current

==== //depot/projects/mpsafetty/sys/sys/tty.h#2 (text+ko) ====


==== //depot/projects/mpsafetty/usr.bin/calendar/calendars/calendar.freebsd#2 (text+ko) ====

@@ -1,7 +1,7 @@
 /*
  * FreeBSD
  *
- * $FreeBSD: src/usr.bin/calendar/calendars/calendar.freebsd,v 1.241 2008/06/19 17:10:05 mav Exp $
+ * $FreeBSD: src/usr.bin/calendar/calendars/calendar.freebsd,v 1.242 2008/07/08 15:43:54 sson Exp $
  */
 
 #ifndef _calendar_freebsd_
@@ -103,6 +103,7 @@
 04/03	Hellmuth Michaelis <hm at FreeBSD.org> born in Kiel, Schleswig-Holstein, Germany, 1958
 04/03	Tong Liu <nemoliu at FreeBSD.org> born in Beijing, People's Republic of China, 1981
 04/03	Gabor Pali <pgj at FreeBSD.org> born in Kunhegyes, Hungary, 1982
+04/05	Stacey Son <sson at FreeBSD.org> born in Burley, Idaho, United States. 1967
 04/08	Jordan K. Hubbard <jkh at FreeBSD.org> born in Honolulu, Hawaii, United States, 1963
 04/09	Ceri Davies <ceri at FreeBSD.org> born in Haverfordwest, Pembrokeshire, United Kingdom, 1976
 04/11	Bruce A. Mah <bmah at FreeBSD.org> born in Fresno, California, United States, 1969

==== //depot/projects/mpsafetty/usr.sbin/pkg_install/create/main.c#2 (text+ko) ====

@@ -10,7 +10,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/create/main.c,v 1.45 2008/06/16 23:41:11 flz Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/create/main.c,v 1.46 2008/07/08 03:21:05 keramida Exp $");
 
 #include <getopt.h>
 #include <err.h>
@@ -208,6 +208,10 @@
 	    Recursive = TRUE;
 	    break;
 
+	case 'n':
+	    Regenerate = FALSE;
+	    break;
+
 	case 0:
 	    if (Help)
 		usage();

==== //depot/projects/mpsafetty/usr.sbin/pkg_install/lib/lib.h#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/usr.sbin/pkg_install/lib/lib.h,v 1.68 2008/06/12 15:21:13 flz Exp $ */
+/* $FreeBSD: src/usr.sbin/pkg_install/lib/lib.h,v 1.69 2008/07/08 03:21:05 keramida Exp $ */
 
 /*
  * FreeBSD install - a package for the installation and maintainance
@@ -105,7 +105,7 @@
  * Version of the package tools - increase only when some
  * functionality used by bsd.port.mk is changed, added or removed
  */
-#define PKG_INSTALL_VERSION	20080612
+#define PKG_INSTALL_VERSION	20080708
 
 #define PKG_WRAPCONF_FNAME	"/var/db/pkg_install.conf"
 #define main(argc, argv)	real_main(argc, argv)


More information about the p4-projects mailing list