Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 2004 01:10:28 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 62421 for review
Message-ID:  <200409300110.i8U1ASA5015057@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=62421

Change 62421 by peter@peter_daintree on 2004/09/30 01:09:48

	IFC @62420

Affected files ...

.. //depot/projects/hammer/UPDATING#58 integrate
.. //depot/projects/hammer/contrib/ngatm/sscop/common.c#4 integrate
.. //depot/projects/hammer/contrib/ngatm/sscop/common.h#4 integrate
.. //depot/projects/hammer/contrib/ngatm/sscop/sscop_main.c#4 integrate
.. //depot/projects/hammer/etc/Makefile#28 integrate
.. //depot/projects/hammer/etc/defaults/rc.conf#36 integrate
.. //depot/projects/hammer/etc/mtree/BIND.chroot.dist#2 integrate
.. //depot/projects/hammer/etc/namedb/named.conf#5 integrate
.. //depot/projects/hammer/etc/rc.bsdextended#1 branch
.. //depot/projects/hammer/etc/rc.d/Makefile#27 integrate
.. //depot/projects/hammer/etc/rc.d/ugidfw#1 branch
.. //depot/projects/hammer/games/fortune/datfiles/fortunes2#16 integrate
.. //depot/projects/hammer/gnu/lib/libobjc/Makefile#7 integrate
.. //depot/projects/hammer/lib/libc/net/addr2ascii.3#5 integrate
.. //depot/projects/hammer/libexec/getty/main.c#5 integrate
.. //depot/projects/hammer/share/man/man5/rc.conf.5#34 integrate
.. //depot/projects/hammer/share/man/man8/diskless.8#9 integrate
.. //depot/projects/hammer/share/man/man9/pfil.9#7 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#74 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mptable.c#32 integrate
.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#111 integrate
.. //depot/projects/hammer/sys/amd64/include/pmap.h#47 integrate
.. //depot/projects/hammer/sys/boot/common/commands.c#4 integrate
.. //depot/projects/hammer/sys/contrib/ipfilter/netinet/ip_fil.c#12 integrate
.. //depot/projects/hammer/sys/contrib/pf/net/pf.c#13 integrate
.. //depot/projects/hammer/sys/contrib/pf/net/pf_ioctl.c#14 integrate
.. //depot/projects/hammer/sys/contrib/pf/net/pfvar.h#8 integrate
.. //depot/projects/hammer/sys/dev/em/if_em.c#29 integrate
.. //depot/projects/hammer/sys/dev/fdc/fdc_acpi.c#6 integrate
.. //depot/projects/hammer/sys/dev/syscons/syscons.c#24 integrate
.. //depot/projects/hammer/sys/dev/usb/ugen.c#20 integrate
.. //depot/projects/hammer/sys/dev/usb/usb_subr.c#16 integrate
.. //depot/projects/hammer/sys/i386/i386/pmap.c#56 integrate
.. //depot/projects/hammer/sys/i386/include/pmap.h#18 integrate
.. //depot/projects/hammer/sys/isa/psm.c#23 integrate
.. //depot/projects/hammer/sys/kern/kern_conf.c#23 integrate
.. //depot/projects/hammer/sys/kern/kern_malloc.c#18 integrate
.. //depot/projects/hammer/sys/net/bridge.c#18 integrate
.. //depot/projects/hammer/sys/net/pfil.c#5 integrate
.. //depot/projects/hammer/sys/net/pfil.h#4 integrate
.. //depot/projects/hammer/sys/netinet/in_pcb.c#29 integrate
.. //depot/projects/hammer/sys/netinet/ip_fastfwd.c#13 integrate
.. //depot/projects/hammer/sys/netinet/ip_fw.h#16 integrate
.. //depot/projects/hammer/sys/netinet/ip_fw2.c#41 integrate
.. //depot/projects/hammer/sys/netinet/ip_fw_pfil.c#5 integrate
.. //depot/projects/hammer/sys/netinet/ip_input.c#43 integrate
.. //depot/projects/hammer/sys/netinet/ip_output.c#40 integrate
.. //depot/projects/hammer/sys/netinet6/ip6_forward.c#11 integrate
.. //depot/projects/hammer/sys/netinet6/ip6_input.c#18 integrate
.. //depot/projects/hammer/sys/netinet6/ip6_output.c#25 integrate
.. //depot/projects/hammer/sys/netkey/key.c#18 integrate
.. //depot/projects/hammer/sys/sparc64/include/smp.h#5 integrate
.. //depot/projects/hammer/sys/sys/param.h#47 integrate

Differences ...

==== //depot/projects/hammer/UPDATING#58 (text+ko) ====

@@ -23,6 +23,11 @@
 	developers choose to disable these features on build machines
 	to maximize performance.
 
+20040929:
+	The pfil API has gained an additional argument to pass an inpcb.
+	You should rebuild all pfil consuming modules: ipfw, ipfilter
+	and pf.
+
 20040928:
 	If enabled, the default is now to run named in a chroot
 	"sandbox." For users with existing configurations in
@@ -1910,4 +1915,4 @@
 Contact Warner Losh if you have any questions about your use of
 this document.
 
-$FreeBSD: src/UPDATING,v 1.365 2004/09/28 13:44:41 dougb Exp $
+$FreeBSD: src/UPDATING,v 1.366 2004/09/29 04:54:31 mlaier Exp $

==== //depot/projects/hammer/contrib/ngatm/sscop/common.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * $FreeBSD: src/contrib/ngatm/sscop/common.c,v 1.2 2004/09/24 22:00:33 trhodes Exp $
+ *
  * $Begemot: libunimsg/sscop/common.c,v 1.4 2004/07/08 08:22:27 brandt Exp $
  */
 

==== //depot/projects/hammer/contrib/ngatm/sscop/common.h#4 (text+ko) ====

@@ -25,7 +25,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * $FreeBSD: src/contrib/ngatm/sscop/common.h,v 1.2 2004/09/24 22:00:33 trhodes Exp $
+ *
  * $Begemot: libunimsg/sscop/common.h,v 1.4 2004/07/08 08:22:27 brandt Exp $
  *
  * Common declaration for the SAAL programs.

==== //depot/projects/hammer/contrib/ngatm/sscop/sscop_main.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * $FreeBSD: src/contrib/ngatm/sscop/sscop_main.c,v 1.2 2004/09/24 22:00:33 trhodes Exp $
+ *
  * $Begemot: libunimsg/sscop/sscop_main.c,v 1.4 2004/07/08 08:22:28 brandt Exp $
  */
 

==== //depot/projects/hammer/etc/Makefile#28 (text+ko) ====

@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
-# $FreeBSD: src/etc/Makefile,v 1.331 2004/09/28 09:45:59 dougb Exp $
+# $FreeBSD: src/etc/Makefile,v 1.332 2004/09/29 06:54:18 ru Exp $
 
 .if !defined(NO_SENDMAIL)
 SUBDIR=	sendmail
@@ -186,7 +186,7 @@
 .endif
 	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
 	    -p ${DESTDIR}/var/named
-	ln -s ${DESTDIR}/var/named/etc/namedb ${DESTDIR}/etc/namedb
+	ln -fhs ${DESTDIR}/var/named/etc/namedb ${DESTDIR}/etc/namedb
 .endif
 .if !defined(NO_SENDMAIL)
 	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/

==== //depot/projects/hammer/etc/defaults/rc.conf#36 (text+ko) ====

@@ -13,7 +13,7 @@
 #
 # All arguments must be in double or single quotes.
 #
-# $FreeBSD: src/etc/defaults/rc.conf,v 1.218 2004/09/28 09:45:59 dougb Exp $
+# $FreeBSD: src/etc/defaults/rc.conf,v 1.220 2004/09/29 07:07:43 trhodes Exp $
 
 ##############################################################
 ###  Important initial Boot-time options  ####################
@@ -468,6 +468,9 @@
 economy_cx_lowest="LOW"			# Offline CPU idle state
 economy_throttle_state="HIGH"		# Offline throttling state
 virecover_enable="YES"	# Perform housekeeping for the vi(1) editor
+ugidfw_enable="NO"	# Load mac_bsdextended(4) rules on boot
+bsdextended_script="/etc/rc.bsdextended"	# Default mac_bsdextended(4)
+						# ruleset file.
 
 ##############################################################
 ### Jail Configuration #######################################

==== //depot/projects/hammer/etc/mtree/BIND.chroot.dist#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BIND.chroot.dist,v 1.2 2004/09/28 09:46:00 dougb Exp $
+# $FreeBSD: src/etc/mtree/BIND.chroot.dist,v 1.5 2004/09/29 03:43:10 dougb Exp $
 #
 # Please see the file src/etc/mtree/README before making changes to this file.
 #
@@ -8,7 +8,7 @@
     dev             mode=0555
     ..
     etc
-        namedb      uname=bind
+        namedb
             master
             ..
             slave   uname=bind
@@ -17,13 +17,15 @@
     ..
 /set type=dir uname=bind gname=wheel mode=0755
     var             uname=root
-	dump
-	..
+        dump
+        ..
         log
         ..
         run
-	    named
+            named
             ..
-	..
+        ..
+        stats
+        ..
     ..
 ..

==== //depot/projects/hammer/etc/namedb/named.conf#5 (text+ko) ====

@@ -1,4 +1,4 @@
-// $FreeBSD: src/etc/namedb/named.conf,v 1.17 2004/09/28 21:22:09 dougb Exp $
+// $FreeBSD: src/etc/namedb/named.conf,v 1.18 2004/09/29 03:49:35 dougb Exp $
 //
 // Refer to the named.conf(5) and named(8) man pages for details.  If
 // you are ever going to set up a primary server, make sure you
@@ -10,6 +10,7 @@
 	directory	"/etc/namedb";
 	pid-file	"/var/run/named/pid";
 	dump-file	"/var/dump/named_dump.db";
+	statistics-file	"/var/stats/named.stats";
 
 // In addition to the "forwarders" clause, you can force your name
 // server to never initiate queries of its own, but always ask its

==== //depot/projects/hammer/etc/rc.d/Makefile#27 (text+ko) ====

@@ -1,5 +1,5 @@
 # $NetBSD: Makefile,v 1.16 2001/01/14 15:37:22 minoura Exp $
-# $FreeBSD: src/etc/rc.d/Makefile,v 1.43 2004/09/15 01:08:33 seanc Exp $
+# $FreeBSD: src/etc/rc.d/Makefile,v 1.44 2004/09/29 00:12:28 trhodes Exp $
 
 FILES=	DAEMON LOGIN NETWORKING SERVERS \
 	abi accounting addswap adjkerntz amd \
@@ -34,7 +34,7 @@
 	serial sppp sshd swap1 \
 	syscons sysctl syslogd \
 	timed tmp \
-	usbd \
+	ugidfw usbd \
 	var vinum virecover \
 	watchdogd \
 	ypbind yppasswdd ypserv \

==== //depot/projects/hammer/games/fortune/datfiles/fortunes2#16 (text+ko) ====

@@ -1,5 +1,5 @@
 This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/fortunes2,v 1.76 2004/07/20 08:32:42 le Exp $
+$FreeBSD: src/games/fortune/datfiles/fortunes2,v 1.77 2004/09/29 19:52:19 wilko Exp $
 %
 =======================================================================
 ||								     ||
@@ -55507,3 +55507,8 @@
 		   nameless to the development team after releasing 
 		   the second version of their product.
 %
+The state that separates its scholars from its warriors will have its
+thinking done by cowards, and its fighting by fools. 
+
+		-- Thucydides
+%

==== //depot/projects/hammer/gnu/lib/libobjc/Makefile#7 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/lib/libobjc/Makefile,v 1.20 2004/07/28 05:27:18 kan Exp $
+# $FreeBSD: src/gnu/lib/libobjc/Makefile,v 1.21 2004/09/29 23:42:44 peter Exp $
 
 OBJCDIR=${.CURDIR}/../../../contrib/libobjc
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
@@ -7,7 +7,12 @@
 
 LIB=    objc
 NOMAN=	sorry
+.if ${MACHINE_ARCH} == "amd64"
+SHLIB_MAJOR= 1
+.else
+# XXX is this still correct?
 NOPIC=	works but method lookup slowdown is significant
+.endif
 
 SRCS=   archive.c class.c encoding.c gc.c hash.c init.c misc.c \
 	nil_method.c objects.c sarray.c selector.c sendmsg.c \

==== //depot/projects/hammer/lib/libc/net/addr2ascii.3#5 (text+ko) ====

@@ -27,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	$ANA: addr2ascii.3,v 1.1 1996/06/13 18:41:46 wollman Exp $
-.\" $FreeBSD: src/lib/libc/net/addr2ascii.3,v 1.15 2004/07/02 23:52:11 ru Exp $
+.\" $FreeBSD: src/lib/libc/net/addr2ascii.3,v 1.16 2004/09/29 17:54:30 maxim Exp $
 .\"
 .Dd June 13, 1996
 .Dt ADDR2ASCII 3
@@ -40,6 +40,7 @@
 .Lb libc
 .Sh SYNOPSIS
 .In sys/types.h
+.In sys/socket.h
 .In netinet/in.h
 .In arpa/inet.h
 .Ft "char *"

==== //depot/projects/hammer/libexec/getty/main.c#5 (text+ko) ====

@@ -42,7 +42,7 @@
 static char sccsid[] = "@(#)from: main.c	8.1 (Berkeley) 6/20/93";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/libexec/getty/main.c,v 1.45 2003/07/18 16:25:55 yar Exp $";
+  "$FreeBSD: src/libexec/getty/main.c,v 1.46 2004/09/29 20:55:14 imp Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -427,37 +427,30 @@
 static int
 opentty(const char *tty, int flags)
 {
-	int i, j = 0;
+	int i;
 	int failopenlogged = 0;
 
-	while (j < 10 && (i = open(tty, flags)) == -1)
+	while ((i = open(tty, flags)) == -1)
 	{
-		if (((j % 10) == 0) && (errno != ENXIO || !failopenlogged)) {
+		if (!failopenlogged) {
 			syslog(LOG_ERR, "open %s: %m", tty);
 			failopenlogged = 1;
 		}
-		j++;
 		sleep(60);
 	}
-	if (i == -1) {
-		syslog(LOG_ERR, "open %s: %m", tty);
-		return 0;
-	}
-	else {
-		if (login_tty(i) < 0) { 
-			if (daemon(0,0) < 0) {
-				syslog(LOG_ERR,"daemon: %m");
-				close(i);
-				return 0;
-			}
-			if (login_tty(i) < 0) {
-				syslog(LOG_ERR, "login_tty %s: %m", tty);
-				close(i);
-				return 0;
-			}
+	if (login_tty(i) < 0) { 
+		if (daemon(0,0) < 0) {
+			syslog(LOG_ERR,"daemon: %m");
+			close(i);
+			return 0;
+		}
+		if (login_tty(i) < 0) {
+			syslog(LOG_ERR, "login_tty %s: %m", tty);
+			close(i);
+			return 0;
 		}
-		return 1;
 	}
+	return 1;
 }
 
 static void

==== //depot/projects/hammer/share/man/man5/rc.conf.5#34 (text+ko) ====

@@ -22,9 +22,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.223 2004/09/20 17:49:57 des Exp $
+.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.224 2004/09/29 07:08:52 trhodes Exp $
 .\"
-.Dd September 20, 2004
+.Dd September 29, 2004
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -3001,6 +3001,17 @@
 recover pre-maturely terminated
 .Xr vi 1
 sessions.
+.It Va ugidfw_enable
+.Dq Li NO
+Load the
+.Xr mac_bsdextended 4
+module upon system initialization and load a default
+ruleset file.
+.It Va bsdextended_script
+.Dq Li Pa /etc/rc.bsdextended
+The default
+.Xr mac_bsdextended 4
+ruleset file to load.
 .It Va ramdisk_units
 .Pq Vt str
 A list of one or more ramdisk units to configure with

==== //depot/projects/hammer/share/man/man8/diskless.8#9 (text+ko) ====

@@ -24,9 +24,9 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man8/diskless.8,v 1.24 2004/06/21 14:23:31 mpp Exp $
+.\" $FreeBSD: src/share/man/man8/diskless.8,v 1.25 2004/09/29 05:28:48 brooks Exp $
 .\"
-.Dd January 10, 2004
+.Dd September 28, 2004
 .Dt DISKLESS 8
 .Os
 .Sh NAME
@@ -146,8 +146,13 @@
 .Nm
 startup and perform
 the actions found in
-.Pa /etc/rc.d/initdiskless
+.Pa /etc/rc.d/initdiskless ,
+.Pa /etc/rc.d/resolv ,
+.Pa /etc/rc.d/tmp ,
 and
+.Pa /etc/rc.d/var .
+On early 5.x releases, the functions of latter three scripts where
+implemented in
 .Pa /etc/rc.d/diskless .
 On older systems, the scripts are located in
 .Pa /etc/rc.diskless1

==== //depot/projects/hammer/share/man/man9/pfil.9#7 (text+ko) ====

@@ -26,9 +26,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man9/pfil.9,v 1.15 2004/08/27 15:16:20 andre Exp $
+.\" $FreeBSD: src/share/man/man9/pfil.9,v 1.16 2004/09/29 04:54:32 mlaier Exp $
 .\"
-.Dd September 8, 2003
+.Dd September 29, 2004
 .Dt PFIL 9
 .Os
 .Sh NAME
@@ -59,9 +59,9 @@
 .Ft void
 .Fn pfil_remove_hook "int (*func)()" "void *arg" "int flags" "struct pfil_head *"
 .Ft int
-.Fn (*func) "void *arg" "struct mbuf **mp" "struct ifnet *" "int dir"
+.Fn (*func) "void *arg" "struct mbuf **mp" "struct ifnet *" "int dir" "struct inpcb *"
 .Ft int
-.Fn pfil_run_hooks "struct pfil_head *head" "struct mbuf **mp" "struct ifnet *" "int dir"
+.Fn pfil_run_hooks "struct pfil_head *head" "struct mbuf **mp" "struct ifnet *" "int dir" "struct inpcb *"
 .Sh DESCRIPTION
 The
 .Nm

==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#74 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.246 2004/09/01 06:42:01 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.247 2004/09/29 01:59:10 peter Exp $");
 
 #include "opt_cpu.h"
 #include "opt_kstack_pages.h"

==== //depot/projects/hammer/sys/amd64/amd64/mptable.c#32 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable.c,v 1.232 2004/07/08 01:42:49 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable.c,v 1.233 2004/09/29 01:58:24 peter Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#111 (text+ko) ====

@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.502 2004/09/22 05:01:48 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.503 2004/09/29 19:20:39 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -110,6 +110,7 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
+#include <sys/malloc.h>
 #include <sys/mman.h>
 #include <sys/msgbuf.h>
 #include <sys/mutex.h>
@@ -212,9 +213,9 @@
 		vm_offset_t va, pd_entry_t ptepde);
 static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m);
 
-static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va);
+static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags);
 
-static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex);
+static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags);
 static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m);
 static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t);
 static vm_offset_t pmap_kmem_choose(vm_offset_t addr);
@@ -1101,22 +1102,26 @@
  * race conditions.
  */
 static vm_page_t
-_pmap_allocpte(pmap, ptepindex)
-	pmap_t	pmap;
-	vm_pindex_t ptepindex;
+_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags)
 {
 	vm_page_t m, pdppg, pdpg;
 
+	KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT ||
+	    (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK,
+	    ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK"));
+
 	/*
 	 * Allocate a page table page.
 	 */
 	if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ |
 	    VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) {
-		PMAP_UNLOCK(pmap);
-		vm_page_unlock_queues();
-		VM_WAIT;
-		vm_page_lock_queues();
-		PMAP_LOCK(pmap);
+		if (flags & M_WAITOK) {
+			PMAP_UNLOCK(pmap);
+			vm_page_unlock_queues();
+			VM_WAIT;
+			vm_page_lock_queues();
+			PMAP_LOCK(pmap);
+		}
 
 		/*
 		 * Indicate the need to retry.  While waiting, the page table
@@ -1156,7 +1161,8 @@
 		pml4 = &pmap->pm_pml4[pml4index];
 		if ((*pml4 & PG_V) == 0) {
 			/* Have to allocate a new pdp, recurse */
-			if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index) == NULL) {
+			if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index,
+			    flags) == NULL) {
 				--m->wire_count;
 				vm_page_free(m);
 				return (NULL);
@@ -1187,7 +1193,8 @@
 		pml4 = &pmap->pm_pml4[pml4index];
 		if ((*pml4 & PG_V) == 0) {
 			/* Have to allocate a new pd, recurse */
-			if (_pmap_allocpte(pmap, NUPDE + pdpindex) == NULL) {
+			if (_pmap_allocpte(pmap, NUPDE + pdpindex,
+			    flags) == NULL) {
 				--m->wire_count;
 				vm_page_free(m);
 				return (NULL);
@@ -1199,7 +1206,8 @@
 			pdp = &pdp[pdpindex & ((1ul << NPDPEPGSHIFT) - 1)];
 			if ((*pdp & PG_V) == 0) {
 				/* Have to allocate a new pd, recurse */
-				if (_pmap_allocpte(pmap, NUPDE + pdpindex) == NULL) {
+				if (_pmap_allocpte(pmap, NUPDE + pdpindex,
+				    flags) == NULL) {
 					--m->wire_count;
 					vm_page_free(m);
 					return (NULL);
@@ -1221,12 +1229,16 @@
 }
 
 static vm_page_t
-pmap_allocpte(pmap_t pmap, vm_offset_t va)
+pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags)
 {
 	vm_pindex_t ptepindex;
 	pd_entry_t *pd;
 	vm_page_t m;
 
+	KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT ||
+	    (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK,
+	    ("pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK"));
+
 	/*
 	 * Calculate pagetable page index
 	 */
@@ -1259,8 +1271,8 @@
 		 * Here if the pte page isn't mapped, or if it has been
 		 * deallocated.
 		 */
-		m = _pmap_allocpte(pmap, ptepindex);
-		if (m == NULL)
+		m = _pmap_allocpte(pmap, ptepindex, flags);
+		if (m == NULL && (flags & M_WAITOK))
 			goto retry;
 	}
 	return (m);
@@ -1848,7 +1860,7 @@
 	 * resident, we are creating it here.
 	 */
 	if (va < VM_MAXUSER_ADDRESS) {
-		mpte = pmap_allocpte(pmap, va);
+		mpte = pmap_allocpte(pmap, va, M_WAITOK);
 	}
 #if 0 && defined(PMAP_DIAGNOSTIC)
 	else {
@@ -2029,7 +2041,8 @@
 				mpte = PHYS_TO_VM_PAGE(*ptepa & PG_FRAME);
 				mpte->wire_count++;
 			} else {
-				mpte = _pmap_allocpte(pmap, ptepindex);
+				mpte = _pmap_allocpte(pmap, ptepindex,
+				    M_WAITOK);
 				if (mpte == NULL)
 					goto retry;
 			}
@@ -2224,7 +2237,13 @@
 		return;
 
 	vm_page_lock_queues();
-	PMAP_LOCK(dst_pmap);
+	if (dst_pmap < src_pmap) {
+		PMAP_LOCK(dst_pmap);
+		PMAP_LOCK(src_pmap);
+	} else {
+		PMAP_LOCK(src_pmap);
+		PMAP_LOCK(dst_pmap);
+	}
 	for (addr = src_addr; addr < end_addr; addr = va_next) {
 		pt_entry_t *src_pte, *dst_pte;
 		vm_page_t dstmpte, srcmpte;
@@ -2303,9 +2322,12 @@
 				 * pte still being around...  allocpte can
 				 * block.
 				 */
-				dstmpte = pmap_allocpte(dst_pmap, addr);
+				dstmpte = pmap_allocpte(dst_pmap, addr,
+				    M_NOWAIT);
+				if (dstmpte == NULL)
+					break;
 				dst_pte = pmap_pte(dst_pmap, addr);
-				if ((*dst_pte == 0) && (ptetemp = *src_pte)) {
+				if (*dst_pte == 0) {
 					/*
 					 * Clear the modified and
 					 * accessed (referenced) bits
@@ -2325,6 +2347,7 @@
 		}
 	}
 	vm_page_unlock_queues();
+	PMAP_UNLOCK(src_pmap);
 	PMAP_UNLOCK(dst_pmap);
 }	
 

==== //depot/projects/hammer/sys/amd64/include/pmap.h#47 (text+ko) ====

@@ -39,7 +39,7 @@
  *
  *	from: hp300: @(#)pmap.h	7.2 (Berkeley) 12/16/90
  *	from: @(#)pmap.h	7.4 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.123 2004/09/11 01:31:26 scottl Exp $
+ * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.124 2004/09/29 19:20:39 alc Exp $
  */
 
 #ifndef _MACHINE_PMAP_H_
@@ -240,7 +240,7 @@
 				mtx_assert(&(pmap)->pm_mtx, (type))
 #define	PMAP_LOCK_DESTROY(pmap)	mtx_destroy(&(pmap)->pm_mtx)
 #define	PMAP_LOCK_INIT(pmap)	mtx_init(&(pmap)->pm_mtx, "pmap", \
-				    NULL, MTX_DEF)
+				    NULL, MTX_DEF | MTX_DUPOK)
 #define	PMAP_LOCKED(pmap)	mtx_owned(&(pmap)->pm_mtx)
 #define	PMAP_MTX(pmap)		(&(pmap)->pm_mtx)
 #define	PMAP_TRYLOCK(pmap)	mtx_trylock(&(pmap)->pm_mtx)

==== //depot/projects/hammer/sys/boot/common/commands.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/commands.c,v 1.19 2003/08/25 23:30:41 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/commands.c,v 1.20 2004/09/29 13:43:55 ru Exp $");
 
 #include <stand.h>
 #include <string.h>
@@ -100,7 +100,7 @@
     }
 }
 
-static void
+static int
 help_emitsummary(char *topic, char *subtopic, char *desc)
 {
     int		i;
@@ -119,7 +119,7 @@
 	} while (i++ < 30);
 	pager_output(desc);
     }
-    pager_output("\n");
+    return (pager_output("\n"));
 }
 
 	    
@@ -162,7 +162,8 @@
     while(help_getnext(hfd, &t, &s, &d)) {
 
 	if (doindex) {		/* dink around formatting */
-	    help_emitsummary(t, s, d);
+	    if (help_emitsummary(t, s, d))
+		break;
 
 	} else if (strcmp(topic, t)) {
 	    /* topic mismatch */
@@ -183,7 +184,8 @@
 		}
 	    } else if ((subtopic == NULL) && (s != NULL)) {
 		/* topic match, list subtopics */
-		help_emitsummary(t, s, d);
+		if (help_emitsummary(t, s, d))
+		    break;
 	    }
 	}
 	free(t);

==== //depot/projects/hammer/sys/contrib/ipfilter/netinet/ip_fil.c#12 (text+ko) ====

@@ -132,7 +132,7 @@
 #if !defined(lint)
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 /* static const char rcsid[] = "@(#)$Id: ip_fil.c,v 2.42.2.34 2001/07/23 13:49:57 darrenr Exp $"; */
-static const char rcsid[] = "@(#)$FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.48 2004/08/27 20:01:08 andre Exp $";
+static const char rcsid[] = "@(#)$FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.49 2004/09/29 04:54:32 mlaier Exp $";
 #endif
 
 extern	struct	protosw	inetsw[];
@@ -312,7 +312,8 @@
 }
 # endif
 #endif /* __NetBSD_Version >= 105110000 && _KERNEL */
-#if (__FreeBSD_version >= 501108) && defined(_KERNEL)
+#if (__FreeBSD_version >= 501108) && (__FreeBSD_version < 600004) && \
+    defined(_KERNEL)
 
 static int
 fr_check_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
@@ -331,7 +332,29 @@
 		ifp, (dir == PFIL_OUT), mp));
 }
 # endif
-#endif /* __FreeBSD_version >= 501108 */
+
+#elif (__FreeBSD_version >= 600004) && defined(_KERNEL)
+
+static int
+fr_check_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir,
+    struct inpcb *inp)
+{
+	struct ip *ip = mtod(*mp, struct ip *);
+	return fr_check(ip, ip->ip_hl << 2, ifp, (dir == PFIL_OUT), mp);
+}
+
+# ifdef USE_INET6
+#  include <netinet/ip6.h>
+
+static int
+fr_check_wrapper6(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir,
+    struct inpcb *inp)
+{
+	return (fr_check(mtod(*mp, struct ip *), sizeof(struct ip6_hdr),
+		ifp, (dir == PFIL_OUT), mp));
+}
+# endif
+#endif /* __FreeBSD_version >= 600004 && _KERNEL */
 #ifdef	_KERNEL
 # if	defined(IPFILTER_LKM) && !defined(__sgi)
 int iplidentify(s)

==== //depot/projects/hammer/sys/contrib/pf/net/pf.c#13 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.19 2004/09/11 11:18:25 mlaier Exp $	*/
+/*	$FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.20 2004/09/29 04:54:32 mlaier Exp $	*/
 /*	$OpenBSD: pf.c,v 1.433.2.2 2004/07/17 03:22:34 brad Exp $ */
 /* add	$OpenBSD: pf.c,v 1.448 2004/05/11 07:34:11 dhartmei Exp $ */
 
@@ -185,11 +185,19 @@
 int			 pf_test_tcp(struct pf_rule **, struct pf_state **,
 			    int, struct pfi_kif *, struct mbuf *, int,
 			    void *, struct pf_pdesc *, struct pf_rule **,
+#ifdef __FreeBSD__
+			    struct pf_ruleset **, struct inpcb *);
+#else
 			    struct pf_ruleset **);
+#endif
 int			 pf_test_udp(struct pf_rule **, struct pf_state **,
 			    int, struct pfi_kif *, struct mbuf *, int,
 			    void *, struct pf_pdesc *, struct pf_rule **,
+#ifdef __FreeBSD__
+			    struct pf_ruleset **, struct inpcb *);
+#else
 			    struct pf_ruleset **);
+#endif
 int			 pf_test_icmp(struct pf_rule **, struct pf_state **,
 			    int, struct pfi_kif *, struct mbuf *, int,
 			    void *, struct pf_pdesc *, struct pf_rule **,
@@ -229,8 +237,13 @@
 			    struct ifnet *, struct pf_state *);
 void			 pf_route6(struct mbuf **, struct pf_rule *, int,
 			    struct ifnet *, struct pf_state *);
+#ifdef __FreeBSD__
 int			 pf_socket_lookup(uid_t *, gid_t *,
+			    int, struct pf_pdesc *, struct inpcb *);
+#else
+int			 pf_socket_lookup(uid_t *, gid_t *,
 			    int, struct pf_pdesc *);
+#endif
 u_int8_t		 pf_get_wscale(struct mbuf *, int, u_int16_t,
 			    sa_family_t);
 u_int16_t		 pf_get_mss(struct mbuf *, int, u_int16_t,
@@ -2376,7 +2389,12 @@
 }
 
 int
+#ifdef __FreeBSD__
+pf_socket_lookup(uid_t *uid, gid_t *gid, int direction, struct pf_pdesc *pd,
+    struct inpcb *inp_arg)
+#else
 pf_socket_lookup(uid_t *uid, gid_t *gid, int direction, struct pf_pdesc *pd)
+#endif
 {
 	struct pf_addr		*saddr, *daddr;
 	u_int16_t		 sport, dport;
@@ -2389,6 +2407,17 @@
 
 	*uid = UID_MAX;
 	*gid = GID_MAX;
+#ifdef __FreeBSD__
+	if (inp_arg != NULL) {
+		INP_LOCK_ASSERT(inp_arg);
+		if (inp_arg->inp_socket) {
+			*uid = inp_arg->inp_socket->so_cred->cr_uid;
+			*gid = inp_arg->inp_socket->so_cred->cr_groups[0];
+			return (1);
+		} else
+			return (0);
+	}
+#endif
 	switch (pd->proto) {
 	case IPPROTO_TCP:
 		sport = pd->hdr.tcp->th_sport;
@@ -2663,7 +2692,12 @@
 int
 pf_test_tcp(struct pf_rule **rm, struct pf_state **sm, int direction,
     struct pfi_kif *kif, struct mbuf *m, int off, void *h,
+#ifdef __FreeBSD__
+    struct pf_pdesc *pd, struct pf_rule **am, struct pf_ruleset **rsm,
+    struct inpcb *inp)
+#else
     struct pf_pdesc *pd, struct pf_rule **am, struct pf_ruleset **rsm)
+#endif
 {
 	struct pf_rule		*nr = NULL;
 	struct pf_addr		*saddr = pd->src, *daddr = pd->dst;
@@ -2742,12 +2776,20 @@
 		else if ((r->flagset & th->th_flags) != r->flags)
 			r = TAILQ_NEXT(r, entries);
 		else if (r->uid.op && (lookup != -1 || (lookup =
+#ifdef __FreeBSD__
+		    pf_socket_lookup(&uid, &gid, direction, pd, inp), 1)) &&
+#else
 		    pf_socket_lookup(&uid, &gid, direction, pd), 1)) &&
+#endif
 		    !pf_match_uid(r->uid.op, r->uid.uid[0], r->uid.uid[1],
 		    uid))
 			r = TAILQ_NEXT(r, entries);
 		else if (r->gid.op && (lookup != -1 || (lookup =
+#ifdef __FreeBSD__
+		    pf_socket_lookup(&uid, &gid, direction, pd, inp), 1)) &&
+#else
 		    pf_socket_lookup(&uid, &gid, direction, pd), 1)) &&
+#endif
 		    !pf_match_gid(r->gid.op, r->gid.gid[0], r->gid.gid[1],
 		    gid))
 			r = TAILQ_NEXT(r, entries);
@@ -3023,7 +3065,12 @@
 int
 pf_test_udp(struct pf_rule **rm, struct pf_state **sm, int direction,
     struct pfi_kif *kif, struct mbuf *m, int off, void *h,
+#ifdef __FreeBSD__
+    struct pf_pdesc *pd, struct pf_rule **am, struct pf_ruleset **rsm,
+    struct inpcb *inp)
+#else
     struct pf_pdesc *pd, struct pf_rule **am, struct pf_ruleset **rsm)
+#endif
 {
 	struct pf_rule		*nr = NULL;
 	struct pf_addr		*saddr = pd->src, *daddr = pd->dst;
@@ -3099,12 +3146,20 @@
 		else if (r->rule_flag & PFRULE_FRAGMENT)
 			r = TAILQ_NEXT(r, entries);
 		else if (r->uid.op && (lookup != -1 || (lookup =
+#ifdef __FreeBSD__
+		    pf_socket_lookup(&uid, &gid, direction, pd, inp), 1)) &&
+#else
 		    pf_socket_lookup(&uid, &gid, direction, pd), 1)) &&
+#endif
 		    !pf_match_uid(r->uid.op, r->uid.uid[0], r->uid.uid[1],
 		    uid))
 			r = TAILQ_NEXT(r, entries);
 		else if (r->gid.op && (lookup != -1 || (lookup =
+#ifdef __FreeBSD__
+		    pf_socket_lookup(&uid, &gid, direction, pd, inp), 1)) &&
+#else
 		    pf_socket_lookup(&uid, &gid, direction, pd), 1)) &&
+#endif
 		    !pf_match_gid(r->gid.op, r->gid.gid[0], r->gid.gid[1],
 		    gid))
 			r = TAILQ_NEXT(r, entries);
@@ -5229,7 +5284,7 @@
 	if (oifp != ifp) {
 #ifdef __FreeBSD__
 		PF_UNLOCK();
-		if (pf_test(PF_OUT, ifp, &m0) != PF_PASS) {
+		if (pf_test(PF_OUT, ifp, &m0, NULL) != PF_PASS) {
 			PF_LOCK();
 			goto bad;
 		} else if (m0 == NULL) {
@@ -5519,7 +5574,7 @@
 	if (oifp != ifp) {
 #ifdef __FreeBSD__
 		PF_UNLOCK();
-		if (pf_test6(PF_OUT, ifp, &m0) != PF_PASS) {
+		if (pf_test6(PF_OUT, ifp, &m0, NULL) != PF_PASS) {
 			PF_LOCK();
 			goto bad;
 		} else if (m0 == NULL) {
@@ -5811,7 +5866,11 @@
 
 #ifdef INET
 int
+#ifdef __FreeBSD__
+pf_test(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp)
+#else
 pf_test(int dir, struct ifnet *ifp, struct mbuf **m0)
+#endif
 {
 	struct pfi_kif		*kif;
 	u_short			 action, reason = 0, log = 0;
@@ -5925,8 +5984,13 @@
 			a = s->anchor.ptr;
 			log = s->log;
 		} else if (s == NULL)
+#ifdef __FreeBSD__
+			action = pf_test_tcp(&r, &s, dir, kif,
+			    m, off, h, &pd, &a, &ruleset, inp);
+#else
 			action = pf_test_tcp(&r, &s, dir, kif,
 			    m, off, h, &pd, &a, &ruleset);
+#endif
 		break;
 	}
 
@@ -5959,8 +6023,13 @@
 			a = s->anchor.ptr;
 			log = s->log;
 		} else if (s == NULL)
+#ifdef __FreeBSD__
 			action = pf_test_udp(&r, &s, dir, kif,
+			    m, off, h, &pd, &a, &ruleset, inp);
+#else
+			action = pf_test_udp(&r, &s, dir, kif,
 			    m, off, h, &pd, &a, &ruleset);
+#endif
 		break;
 	}
 
@@ -6137,7 +6206,11 @@
 
 #ifdef INET6
 int
+#ifdef __FreeBSD__
+pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp)
+#else
 pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0)
+#endif
 {
 	struct pfi_kif		*kif;
 	u_short			 action, reason = 0, log = 0;
@@ -6274,8 +6347,13 @@
 			a = s->anchor.ptr;
 			log = s->log;
 		} else if (s == NULL)
+#ifdef __FreeBSD__
+			action = pf_test_tcp(&r, &s, dir, kif,
+			    m, off, h, &pd, &a, &ruleset, inp);
+#else
 			action = pf_test_tcp(&r, &s, dir, kif,

>>> TRUNCATED FOR MAIL (1000 lines) <<<



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